PubmathmultiplyFloats

Hi,

Seems like there is a bug for pub.math:multiplyFloats service. If you pass num1 value as 39.38 and num2 value as 100, output will be 3938.0000000000005.There are few more values like this.

Thanks,

Pauly

Hi,

Its not a bug. I would have to round the value for 2 decimals to get my desired value.

Thanks,

Pauly

This is an old wM issue, because it treats the numbers as double rather than float. Even pub.math:addFloats also gives incorrect results for certain values. Try adding 104.42 + 21.10 addFloats will give you 125.52000000000001

Rounding may work sometime, but not always.

You may write your own java service and convert the numbers to float or BigDecimal to do math.

Kazi

Hi,

There is an article on problems with using floats and doubles written by Rob Eamon.

[url=“wmusers.com”]wmusers.com

HTH

Vikram