A floating point divide by zero with exceptions masked is aNaN. The compiler should warn about these cases and optimize to NaN not error them as they may be deliberate portable(ish) ways to return NaN
The regression test uses a subnormal number 1e-38, but the floating point division does not support subnormal numbers. I suggest to change it to 1.18e-38.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Should that not be Infinity?
See http://www.gnu.org/software/libc/manual/html_node/Infinity-and-NaN.html
Yep the code is using 0.0/0.0 for NaN and 1.0/0.0 for infinity
Fixed in revision #9742.
Hi Ben,
Check the comment header in sdcc/device/lib/isinf.c. It says NaN (Not a Number).
Thanks!
Thanks. I have fixed it in revision #9743.
The regression test uses a subnormal number 1e-38, but the floating point division does not support subnormal numbers. I suggest to change it to 1.18e-38.