-
-
Notifications
You must be signed in to change notification settings - Fork 24k
NaN, INF read/write bug fixed #40619
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
NaN, INF read/write bug fixed #40619
Conversation
9385a08 to
1c90493
Compare
core/variant_parser.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rtoss uses sprintf, and it can have more output variants depending on system / C runtime:
- C99 standard CRTs should output
inf,nan,nan(snan),nan(ind). - Old Visual Studio CRTs (MinGW may use it too) will output it as
1.#INF random-digits,.#IND random-digitsor.#NAN random-digits.
And any of these can be prefixed by -.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I'm checking before stringifying the the value, but not sure could it be there any negative nan
@bruvzg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think there's any meaning to the sign of NaN if it is set, it's just artifact of previous operation. isnan should handle any NaN correctly and there's not reason to save it.
1c90493 to
508dcbc
Compare
|
@ThakeeNathees Is this still desired? If so, it needs to be rebased and tested on the latest master branch. |
|
This is something I'd like to see merged in in 3.x as well. This issue is currently annoying me in my own project. If necessary, I'm willing to fork this branch and open new PRs. |
|
@briansemrau Since ThakeeNathees appears to be inactive, I'd suggest opening a rebased version of this pull request against the |
|
Superseded by #47497. |
Fix: #40589
writing and parsing
-nan(ind)and-infdamage the .tscn file as the first negative eaten as float (-0.0) and the reset identifier is unexpected and parsing(reading) these special case would break stuff so I've changed them tonan,"inf_neg"respectively.(regardless of the sign of the NAN, godot using
-nan(ind)for both)