minix/lib/math/hugeval.c

24 lines
541 B
C
Raw Normal View History

2005-04-21 16:53:53 +02:00
/*
* (c) copyright 1990 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*
* Author: Hans van Eck
*/
/* $Header$ */
2009-08-18 21:10:20 +02:00
#include <assert.h>
2005-04-21 16:53:53 +02:00
#include <math.h>
double
__huge_val(void)
{
2009-08-18 21:10:20 +02:00
#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
2005-04-21 16:53:53 +02:00
return 1.0e+1000; /* This will generate a warning */
2009-08-18 21:10:20 +02:00
#endif
2005-04-21 16:53:53 +02:00
}