1 #pragma once 2 3 typedef __int32 int32_t; 4 typedef unsigned __int32 u_int32_t; 5 6 typedef union 7 { 8 double value; 9 struct 10 { 11 u_int32_t lsw; 12 u_int32_t msw; 13 } parts; 14 } ieee_double_shape_type; 15 16 #define EXTRACT_WORDS(ix0,ix1,d) \ 17 do { \ 18 ieee_double_shape_type ew_u; \ 19 ew_u.value = (d); \ 20 (ix0) = ew_u.parts.msw; \ 21 (ix1) = ew_u.parts.lsw; \ 22 } while (0) 23 24 /* Get the more significant 32 bit int from a double. */ 25 26 #define GET_HIGH_WORD(i,d) \ 27 do { \ 28 ieee_double_shape_type gh_u; \ 29 gh_u.value = (d); \ 30 (i) = gh_u.parts.msw; \ 31 } while (0) 32 33 #define GET_LOW_WORD(i,d) \ 34 do { \ 35 ieee_double_shape_type gl_u; \ 36 gl_u.value = (d); \ 37 (i) = gl_u.parts.lsw; \ 38 } while (0) 39 40 static __inline double __ieee754_sqrt(double x) {return sqrt(x);} 41 static __inline double __ieee754_log(double x) {return log(x);} 42 static __inline double __cos(double x) {return cos(x);} 43 static __inline void __sincos(double x, double *s, double *c) 44 { 45 *s = sin(x); 46 *c = cos(x); 47 } 48 49 double __ieee754_j0(double); 50 double __ieee754_j1(double); 51 double __ieee754_jn(int, double); 52 double __ieee754_y0(double); 53 double __ieee754_y1(double); 54 double __ieee754_yn(int, double); 55