]> Zhao Yanbai Git Server - minix.git/commitdiff
Fix HUGE_VAL warnings
authorErik van der Kouwe <erik@minix3.org>
Tue, 18 Aug 2009 19:10:20 +0000 (19:10 +0000)
committerErik van der Kouwe <erik@minix3.org>
Tue, 18 Aug 2009 19:10:20 +0000 (19:10 +0000)
lib/math/hugeval.c

index 2a5b52684e263b5b2b380ac3fabe0267562c730a..3f4bf13e089600cd3780b40b4f68406ec88472a6 100755 (executable)
@@ -5,10 +5,19 @@
  * Author: Hans van Eck
  */
 /* $Header$ */
+#include       <assert.h>
 #include       <math.h>
 
 double
 __huge_val(void)
 {
+#if (CHIP == INTEL)
+       static unsigned char ieee_infinity[] = { 
+               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f };
+
+       assert(sizeof(double) == sizeof(ieee_infinity));
+       return *(double *) ieee_infinity;
+#else
        return 1.0e+1000;       /* This will generate a warning */
+#endif
 }