Ticket #6230: math.h.3.diff
File math.h.3.diff, 1.8 KB (added by , 14 years ago) |
---|
-
headers/posix/math.h
21 21 #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ 22 22 23 23 /* platform independent IEEE floating point special values */ 24 #define __HUGE_VAL_v 0x7ff0000000000000LL 25 #define __huge_val_t union { unsigned char __c[8]; long long __ll; double __d; } 26 #ifndef HUGE_VAL 27 # define HUGE_VAL (((__huge_val_t) { __ll: __HUGE_VAL_v }).__d) 28 #endif 24 #if __GNUC__ >= 4 25 /*gcc4 and clang definitions*/ 29 26 30 # define __HUGE_VALF_v 0x7f800000L31 # define __huge_valf_t union { unsigned char __c[4]; long __l; float __f; }32 # define HUGE_VALF (((__huge_valf_t) { __l: __HUGE_VALF_v }).__f)27 # ifndef HUGE_VAL 28 # define HUGE_VAL __builtin_huge_val() 29 # endif 33 30 31 # define HUGE_VALF __builtin_huge_valf() 32 33 # define HUGE_VALL __builtin_huge_vall() 34 35 # define NAN __builtin_nanf("") 36 37 # define INFINITY __builtin_inff() 38 39 #else 40 /*gcc2 definitions*/ 41 # define __HUGE_VAL_v 0x7ff0000000000000LL 42 # define __huge_val_t union { unsigned char __c[8]; long long __ll; double __d; } 43 # ifndef HUGE_VAL 44 # define HUGE_VAL (((__huge_val_t) { __ll: __HUGE_VAL_v }).__d) 45 # endif 46 47 # define __HUGE_VALF_v 0x7f800000L 48 # define __huge_valf_t union { unsigned char __c[4]; long __l; float __f; } 49 # define HUGE_VALF (((__huge_valf_t) { __l: __HUGE_VALF_v }).__f) 50 34 51 /* TODO: define HUGE_VALL for long doubles */ 35 52 36 # define __NAN_VALF_v 0x7fc00000L37 # define NAN (((__huge_valf_t) { __l: __NAN_VALF_v }).__f)53 # define __NAN_VALF_v 0x7fc00000L 54 # define NAN (((__huge_valf_t) { __l: __NAN_VALF_v }).__f) 38 55 39 # define INFINITY HUGE_VALF56 # define INFINITY HUGE_VALF 40 57 58 #endif 59 41 60 /* floating-point categories */ 42 61 #define FP_NAN 0 43 62 #define FP_INFINITE 1