Part of the subject fix includes:
The pub.math:multiplyFloats service returns values without
rounding them correctly.
On Intel platforms (Windows or Linux), the
pub.math:multiplyFloats service returns values with too many
digits after the decimal point for input values that end in
.20 or .30. For example, if 3 and 13.20 are supplied as inputs,
the returned value is 39.599999999999994 instead of 39.60.
This issue is specific to Java on Intel platforms. To remedy this
issue, the pub.math:multiplyFloats service now uses the
java.math.BigDecimal implementation, which adds the ability to
round the values correctly.
This appears to be a misunderstanding of binary floating point. For example, the decimal value of 0.1 is a repeater fraction 0.0001100110011…
Floating point by its nature is inexact (inaccurate). Common “fixes” are to use rounding techniques.
For a more thorough explanation, refer to these sites:
This is not a Java nor an Intel problem. It is a binary representation issue. I’m not sure who might lurking on these forums (this my first venture into this community) but my recommendation is:
Restore mulitplyFloats to its prior (and correct) operation which should not include any rounding (or use of BigDecimal). Float/double should not be used when accuracy is necessary (monetary calculations, for example).
Add a set of decimal services, such as addDecimals, multipleDecimals, etc. (perhaps using BigDecimal or other class for implementation) for proper decimal behavior.