/* Copyright (c) 1994 Xerox Corporation. All rights reserved. */ #include /* $Id$ $Date$ * * The ieee float constants here were taken from SunOS 4.1.3 */ #include #include #include #include #if defined(PCR_OS_SUNOS4) || defined(PCR_OS_SUNOS5) \ || defined(PCR_OS_IRIX4) || defined(PCR_OS_IRIX5) int PCR_EmuHDieee_Dummy(double x) { /* SVID & X/Open */ x = erf(x); x = erfc(x); x = gamma(x); x = hypot(x,x); x = j0(x); x = j1(x); x = jn(11,x); x = lgamma(x); x = y0(x); x = y1(x); x = yn(11,x); /* SVID */ x = acosh(x); x = asinh(x); x = atanh(x); return 0; } # if defined(PCR_OS_SUNOS4) int PCR_EmuHDieee_DummyFPClass(double x) { return (int) fp_class(x); } # else int fp_class(double x) { return (int) fpclass(x); } # endif #elif defined(PCR_OS_OS2) || defined(PCR_OS_linux) || defined(PCR_OS_bsdi) /* don't know what to do here, but skip it for now */ #else # error ieee float? #endif /* * IEEE double precision constants */ static double align__double = 0.0; #if defined(PCR_Arch_ENDIAN0123) /* little-endian */ static long ln2x[] = { 0xfefa39ef, 0x3fe62e42 }; static long ln2hix[] = { 0xfee00000, 0x3fe62e42 }; static long ln2lox[] = { 0x35793c76, 0x3dea39ef }; static long NaNx[] = { 0xffffffff, 0x7fffffff }; static long sNaNx[] = { 0x00000001, 0x7ff00000 }; static long Infx[] = { 0x00000000, 0x7ff00000 }; static long two52x[] = { 0x00000000, 0x43300000 }; static long twom52x[] = { 0x00000000, 0x3cb00000 }; static long PI_RZx[] = { 0x54442d18, 0x400921fb }; static long sqrt2x[] = { 0x667f3bcd, 0x3ff6a09e };/* rounded up */ static long sqrt2p1_hix[] = { 0x333f9de6, 0x4003504f }; static long sqrt2p1_lox[] = { 0xf626cdd5, 0x3ca21165 }; static long fmaxx[] = { 0xffffffff, 0x7fefffff }; static long fminx[] = { 0x00000001, 0x00000000 }; static long fminnx[] = { 0x00000000, 0x00100000 }; static long fmaxsx[] = { 0xffffffff, 0x000fffff }; static long lnovftx[] = { 0xfefa39ef, 0x40862e42 };/* chopped */ static long lnunftx[] = { 0xd52d3052, 0xc0874910 };/* ln(minf/2) chop*/ static long invln2x[] = { 0x652b82fe, 0x3ff71547 }; #elif defined(PCR_ARCH_ENDIAN3210) /* big-endian */ static long ln2x[] = { 0x3fe62e42, 0xfefa39ef }; static long ln2hix[] = { 0x3fe62e42, 0xfee00000 }; static long ln2lox[] = { 0x3dea39ef, 0x35793c76 }; static long NaNx[] = { 0x7fffffff, 0xffffffff }; static long sNaNx[] = { 0x7ff00000, 0x00000001 }; static long Infx[] = { 0x7ff00000, 0x00000000 }; static long two52x[] = { 0x43300000, 0x00000000 }; static long twom52x[] = { 0x3cb00000, 0x00000000 }; static long PI_RZx[] = { 0x400921fb, 0x54442d18 }; static long sqrt2x[] = { 0x3ff6a09e, 0x667f3bcd };/* rounded up */ static long sqrt2p1_hix[] = { 0x4003504f, 0x333f9de6 }; static long sqrt2p1_lox[] = { 0x3ca21165, 0xf626cdd5 }; static long fmaxx[] = { 0x7fefffff, 0xffffffff }; static long fminx[] = { 0x00000000, 0x00000001 }; static long fminnx[] = { 0x00100000, 0x00000000 }; static long fmaxsx[] = { 0x000fffff, 0xffffffff }; static long lnovftx[] = { 0x40862e42, 0xfefa39ef };/* chopped */ static long lnunftx[] = { 0xc0874910, 0xd52d3052 };/* ln(minf/2) chop*/ static long invln2x[] = { 0x3ff71547, 0x652b82fe }; #else # error constants not known #endif #define ln2 (*(double*)ln2x) #define NaN (*(double*)NaNx) #define sNaN (*(double*)sNaNx) #define Inf (*(double*)Infx) #define two52 (*(double*)two52x) #define twom52 (*(double*)twom52x) #define ln2hi (*(double*)ln2hix) #define ln2lo (*(double*)ln2lox) #define PI_RZ (*(double*)PI_RZx) #define sqrt2 (*(double*)sqrt2x) #define sqrt2p1_hi (*(double*)sqrt2p1_hix) #define sqrt2p1_lo (*(double*)sqrt2p1_lox) #define fmax (*(double*)fmaxx) #define fmin (*(double*)fminx) #define fminn (*(double*)fminnx) #define fmaxs (*(double*)fmaxsx) #define lnovft (*(double*)lnovftx) #define lnunft (*(double*)lnunftx) #define invln2 (*(double*)invln2x) double min_subnormal(void) { return fmin; } double max_subnormal(void) { return fmaxs; } double min_normal(void) { return fminn; } double max_normal(void) { return fmax; } double infinity(void) { return Inf; } double quiet_nan(long n) { return NaN; } double signaling_nan(long n) { return sNaN; } /* $Log$ */