Add support for hex floating point literals #9561
-
A So what about adding support for hex floating point literals? (which can always losslessly be converted to binary float/double). For example this value (which can readily be written to a 64 bit value that comprises a
cannot be expressed in decimal the best we can do is:
No matter what we write in decimal form, we can never get this value into the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 17 replies
-
I don't think this is actually true. If all valid finite floats are binary fractions, then they all have terminating decimal representations (specifically, I believe the criteria for a terminating decimal is that the denominator's only prime factors are 2 and/or 5). In the case of your specific example, according to this site it should be ![]() |
Beta Was this translation helpful? Give feedback.
-
Now that parsing has been fixed to return the nearest number and formatting has been fixed to return roundtrippable strings from |
Beta Was this translation helpful? Give feedback.
-
See: #7277 |
Beta Was this translation helpful? Give feedback.
See: #7277