-
Notifications
You must be signed in to change notification settings - Fork 171
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
SQRT of negative numbers #2163
Comments
For But I'm not sure NaNs are handled consistently by libraries and compilers if provided as input to a function chain. I'll need to think about that one. |
I had to do something for the Sinclair ROMs, it simply interrupted the runtime by jumping to BASIC and giving an "Invalid argument" error. |
Well a bit of a rough check through shows that NaN values are not generated, except for the The There is no NaN included in the C header files to return. Perhaps that should be added (below for IEEE754), and then returned as needed? #define NAN_POS_F32 ((unsigned long)0x7FFFFFFF)
#define NAN_NEG_F32 ((unsigned long)0xFFFFFFFF) The But otherwise the |
Resolved some weaknesses with #2166. |
math32 - produce NaNs where needed - #2163
In C the result of SQRT of negative numbers is often forced to zero.
It appears to be the preferred behavior, e.g. it fixes this: https://github.com/z88dk/z88dk-ext/blob/master/graphics/hat.c
The default high precision math library works fine, the target specific ones and the alternative ones might require a calibration.
The text was updated successfully, but these errors were encountered: