This is the mail archive of the newlib@sourceware.cygnus.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

isnan and isinf when double_is_32bits


isnan and isinf are missing in mathfp when DOUBLE_IS_32BITS is defined.
To correct this I've inserted calls to isnanf and isinff in s_isnan.c
and s_isinf.c, e.g:

diff -uNr -x *~ newlib-1.8.2.vanilla/newlib/libm/mathfp/s_isnan.c
newlib-1.8.2/newlib/libm/mathfp/s_isnan.c
--- newlib-1.8.2.vanilla/newlib/libm/mathfp/s_isnan.c	Tue Mar  2
18:05:33 1999
+++ newlib-1.8.2/newlib/libm/mathfp/s_isnan.c	Sun Feb 13 20:28:26 2000
@@ -122,4 +122,11 @@
     return (0);
 }
 
-#endif /* _DOUBLE_IS_32BITS */
+#else
+
+int isnan (double x)
+{
+    return isnanf((float)x);
+}
+
+#endif /* DOUBLE_IS_32BITS */


This may not be the best way to handle this case in general. Would the
maintainers have any better ideas?

Thanks,

Ran Cabell
rcabell@norfolk.infi.net

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]