-
Notifications
You must be signed in to change notification settings - Fork 1.2k
JSONEncoder
floating point behavior differs between Darwin and non-Darwin implementation
#4704
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
Comments
If I had a vote, I would vote for the non-Darwin behavior, which is neater. One could argue the Darwin behavior is more precise but I think that argument misses the fact that floating point is imprecise to begin with… one cannot tell whether the floating point value actually represents So, in the absence of precision, I would suggest choosing the neater one. |
This Swift commit changed Swift’s floating point formatting logic, mentioning the following:
|
Filed FB11996256 requesting that the Darwin implementation be updated to match the non-Darwin implementation. |
i want to contribute in this project please assign it to me. |
@21DCS059 See above comment. There shouldn’t be any action needed in this repository. Instead, I filed FB11996256, which requests that Apple modify their closed-source version of Foundation. |
This produces |
The floating point behavior of
JSONEncoder
differs between the Darwin and non-Darwin implementation of Foundation.Test Case
Darwin Output
Non-Darwin Output
The text was updated successfully, but these errors were encountered: