-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Support parsing snan
#11573
Comments
@tannergooding I marked this Future |
I think I think, the easiest fix, would be to support this only for the invariant culture and only support it for parsing (that is, you can would never get
@jkotas, do you think the above would alleviate the concerns you raised? |
I would wait for somebody to ask for this. It does not look important to me to fix. What does Java or Python do for parsing / formatting snans? |
Both format quiet and signalling NaN to the same result I agree that it isn't particularly important to fix, but it would be nice to check the box off indicating that we support this particular IEEE requirement, especially since we are allowed to quietly convert it to a |
Tagging subscribers to this area: @tannergooding |
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process. This process is part of our issue cleanup automation. |
The IEEE 754:2008 specification requires that we be able to recover a string matching "snan" (case-insensitive) with an optional preceding sign. We are not required to recover this to an actual
snan
and are permitted to silently convert it to aqnan
(such asdouble.NaN
orfloat.NaN
) instead.@jkotas raised some concern around this on https://github.com/dotnet/coreclr/issues/19802 given that it may require a new public surface and due to it not being unusual to have
NaN
checked for by string comparisonAt a minimum, we should update the invariant culture to check for
snan
and returndouble.NaN
orfloat.NaN
. Optionally, and if it is determined to not be breaking, we can add aNumberFormatInfo.SignallingNaN
and provide culture specificsnan
information.I don't believe either of these should be considered breaking since we are only parsing new values. What could be breaking is if we start formatting
snan
toNumberFormatInfo.SignallingNaN
, as that may break existing code that checks forNaN
by string comparison (we currently don't, as IEEE allows us to silently convert a signalling NaN into the quiet nan string: "NaN").The text was updated successfully, but these errors were encountered: