1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- #ifndef _MATH_H
- # error "Never use <bits/huge_val.h> directly; include <math.h> instead."
- #endif
- #include <features.h>
- #include <sys/cdefs.h>
- #ifdef __GNUC__
- # if __GNUC_PREREQ(2,96)
- # define HUGE_VAL (__extension__ 0x1.0p2047)
- # else
- # define HUGE_VAL \
- (__extension__ \
- ((union { unsigned long long __l; double __d; }) \
- { __l: 0x7ff0000000000000ULL }).__d)
- # endif
- #else
- static union { unsigned char __c[8]; double __d; } __huge_val =
- { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
- # define HUGE_VAL (__huge_val.__d)
- #endif
- #ifdef __USE_ISOC99
- # if __GNUC_PREREQ(2,96)
- # define HUGE_VALF (__extension__ 0x1.0p255f)
- # define HUGE_VALL (__extension__ 0x1.0p32767L)
- # else
- # ifdef __GNUC__
- # define HUGE_VALF \
- (__extension__ \
- ((union { unsigned long __l; float __f; }) \
- { __l: 0x7f800000UL }).__f)
- # define HUGE_VALL \
- (__extension__ \
- ((union { unsigned long __l[3]; long double __ld; }) \
- { __l: { 0x7fff0000UL, 0x80000000UL, 0UL } }).__ld)
- # else
- static union { unsigned char __c[4]; float __f; } __huge_valf =
- { { 0x7f, 0x80, 0, 0 } };
- # define HUGE_VALF (__huge_valf.__f)
- static union { unsigned char __c[12]; long double __ld; } __huge_vall =
- { { 0x7f, 0xff, 0, 0, 0x80, 0, 0, 0, 0, 0, 0, 0 } };
- # define HUGE_VALL (__huge_vall.__ld)
- # endif
- # endif
- #endif
|