From: Erik van der Kouwe Date: Tue, 18 Aug 2009 19:10:20 +0000 (+0000) Subject: Fix HUGE_VAL warnings X-Git-Tag: v3.1.5~179 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=d81563a9b12fa8d2a1127abd930bcea9dc817797;p=minix.git Fix HUGE_VAL warnings --- diff --git a/lib/math/hugeval.c b/lib/math/hugeval.c index 2a5b52684..3f4bf13e0 100755 --- a/lib/math/hugeval.c +++ b/lib/math/hugeval.c @@ -5,10 +5,19 @@ * Author: Hans van Eck */ /* $Header$ */ +#include #include 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 }