New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make converting a double/float to a string (or vice-versa) IEEE compliant #11024
Comments
CC. @danmosemsft, @jkotas |
Completed: |
Negative/Positive infinity are interesting as today we produce the unicode |
NaN should be trivial if we don't want to support the optional parts, we just need to change the parsing to case insensitive, and also support "snan" being recovered to |
The |
For both parsing and formatting values we use the I would presume the desired direction is to always strictly follow the This would, for netcore3.0, result in the following new behavior... When Formatting:
When Parsing:
Things to determine:
|
I would spin a separate issue for SNaN. It is a new public surface and it has the highest breaking potential from all of the above. It is not unusual to see checking for NaN by string comparison. |
Closing this as the majority of issues have been addressed:
|
This tracks essentially all the IEEE 754:2008 requirements:
Positive Zero
Negative Zero
Positive Infinity
Negative Infinity
Quiet NaN
Signalling NaN
Finite (non-zero) Numbers
M
digits, whereM=17
for double andM=9
for singleH
, if any, on significant digits converted must be>= M + 3
(20
for double and12
for single)H
digits are requested must be padded with zerosH
digits must be correctly rounded toH
digits and then convertedThe text was updated successfully, but these errors were encountered: