mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-17 03:49:46 +08:00
d2c2c1328b
* libc/include/math.h (HUGE_VALF, HUGE_VALL): New. * libm/common/Makefile.am: Add s_infconst.c support. * libm/common/Makefile.in: Regenerated. * libm/common/s_infconst.c: New file with float and long double infinity support added. * libm/math/Makefile.am: Remove s_infconst.c support. * libm/math/Makefile.in: Regenerated. * libm/math/s_infconst.c: Moved to common directory. * libm/mathfp/Makefile.am: Remove s_infconst.c support. * libm/mathfp/Makefile.in: Regenerated. * libm/mathfp/s_infconst.c: Moved to common directory.
41 lines
1.3 KiB
C
41 lines
1.3 KiB
C
/* Infinity as a constant value. This is used for HUGE_VAL.
|
|
* Added by Cygnus Support.
|
|
*/
|
|
|
|
#include <float.h>
|
|
#include "fdlibm.h"
|
|
|
|
/* Float version of infinity. */
|
|
const union __fmath __infinityf[1] = {{{0x7f800000}}};
|
|
|
|
/* Double version of infinity. */
|
|
#ifndef _DOUBLE_IS_32BITS
|
|
#ifdef __IEEE_BIG_ENDIAN
|
|
const union __dmath __infinity[1] = {{{0x7ff00000, 0}}};
|
|
#else
|
|
const union __dmath __infinity[1] = {{{0, 0x7ff00000}}};
|
|
#endif
|
|
#else /* defined (_DOUBLE_IS_32BITS) */
|
|
const union __dmath __infinity[1] = {{{0x7f800000, 0}}};
|
|
#endif /* defined (_DOUBLE_IS_32BITS) */
|
|
|
|
/* Long double version of infinity. */
|
|
#ifdef __IEEE_BIG_ENDIAN
|
|
#if LDBL_MANT_DIG == 24
|
|
const union __ldmath __infinityld[1] = {{{0x7f800000, 0, 0, 0}}};
|
|
#elif LDBL_MANT_DIG == 53
|
|
const union __ldmath __infinityld[1] = {{{0x7ff00000, 0, 0, 0}}};
|
|
#else
|
|
const union __ldmath __infinityld[1] = {{{0x7fff0000, 0, 0, 0}}};
|
|
#endif /* LDBL_MANT_DIG size */
|
|
#else /* __IEEE_LITTLE_ENDIAN */
|
|
#if LDBL_MANT_DIG == 24
|
|
const union __ldmath __infinityld[1] = {{{0x7f800000, 0, 0, 0}}};
|
|
#elif LDBL_MANT_DIG == 53
|
|
const union __ldmath __infinityld[1] = {{{0, 0x7ff00000, 0, 0}}};
|
|
#else
|
|
const union __ldmath __infinityld[1] = {{{0, 0x80000000, 0x00007fff, 0}}};
|
|
#endif /* LDBL_MANT_DIG size */
|
|
#endif /* __IEEE_LITTLE_ENDIAN */
|
|
|