Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
(Java) V4 4.8.0
-
None
-
None
Description
As per
If a decimal string with at most 15 significant digits is converted to IEEE 754 double-precision representation, and then converted back to a decimal string with the same number of digits, the final result should match the original string*.* If an IEEE 754 double-precision number is converted to a decimal string with at least 17 significant digits, and then converted back to double-precision representation, the final result must match the original number.
The string 5.9999999999999998e-01 parsed back to Double is equal to 0.6.
These validations often fail and POST requests having payloads with values like as 0.5, 0.6, 1.1 will get converted to 5e-1, 5.99999e-1...
The line causing the isue is in Edm.Single and Edm.Double classes
if (result.isInfinite() || BigDecimal.valueOf(result).compareTo(bigDecimalValue) != 0) {...