Jul 31, 2020
Posted by Ken

Real is a pure 64-bit floating point value (Java double), so it does not have a precision.  That is what Decimal is for.  What about its string representation doesn’t work?

It may look like you get back 3.23, but since this is a binary floating point representation, that may not be what you really have.  For example:

(0.1 + 0.2 == 0.3)

Actually evaluates to false, not true.

© Vantiq 2024 All rights reserved  •  Vantiq Corporation’s Privacy Policy and Cookie Policy