Describe the bug
Libm currently defines NAN as
#define NAN ((float)(INFINITY * 0.0f))
when it should actually be
#define NAN (0.0f/0.0f)
It isn't defined like this because of the incorrect-flush-to-zero bug in VBCC described in another ticket. The multiply-by-zero however likely doesn't produce a nan either.
To Reproduce
Write code that uses the NAN define
Expected behavior
Should produce a type correct NAN (float, double, long double).
OS (please complete the following information):
Additional context
Keep in mind that the NAN define can not depend on a global variable. Libc expects that it can #include<math.h> and use the NAN and INFINITY defines without having to actually link in libm.
Describe the bug
Libm currently defines NAN as
#define NAN ((float)(INFINITY * 0.0f))when it should actually be
#define NAN (0.0f/0.0f)It isn't defined like this because of the incorrect-flush-to-zero bug in VBCC described in another ticket. The multiply-by-zero however likely doesn't produce a nan either.
To Reproduce
Write code that uses the NAN define
Expected behavior
Should produce a type correct NAN (float, double, long double).
OS (please complete the following information):
Additional context
Keep in mind that the NAN define can not depend on a global variable. Libc expects that it can #include<math.h> and use the NAN and INFINITY defines without having to actually link in libm.