#ifndef __MATH_LOADED #define __MATH_LOADED 1 /**************************************************************************** ** ** - Mathematics ** ***************************************************************************** ** Header introduced by the ANSI C Standard ***************************************************************************** ** ** Copyright 2000 Compaq Computer Corporation ** ** Compaq and the Compaq logo Registered in U.S. Patent and Trademark Office. ** ** Confidential computer software. Valid license from Compaq required for ** possession, use or copying. Consistent with FAR 12.211 and 12.212, ** Commercial Computer Software, Computer Software Documentation, and ** Technical Data for Commercial Items are licensed to the U.S. Government ** under vendor's standard commercial license. ** ****************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif /* ** 64-BIT SUPPORT NOTE: ** ** The modf* and frexp* routines all make calls directly into the DPML ** library. Until it is known whether DPML supports 64-bit pointers, ** the following functions in this module, which by the way are the only ** functions which seem to need conversion, can not be converted to 64 bit ** pointers: ** ** frexp frexpf frexpl ** modf modff modfl */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 #endif /* ** Member align structures */ #pragma __member_alignment __save #pragma __member_alignment /* ** Define HUGE_VAL */ #if __G_FLOAT # define HUGE_VAL 8.988465674311578540726371186585e+307 # define __MAXFLOAT 1.7014117e+38f #elif __IEEE_FLOAT # if defined (_IEEE_FP) && (__CRTL_VER >= 60200000) # pragma __extern_model __save # pragma __extern_model __strict_refdef extern double decc$gt_dbl_infinity; # pragma __extern_model __restore # define HUGE_VAL decc$gt_dbl_infinity # else # define HUGE_VAL 1.7976931348623158e+308 # endif # define __MAXFLOAT 3.40282347e+38f #else # ifdef __ALPHA # define HUGE_VAL 1.70141183460469213e+38 # else # define HUGE_VAL 1.70141183460469229e+38 # endif # define __MAXFLOAT 1.7014117e+38f #endif /* ** MAXFLOAT is defined by X/Open extended to be the maximum ** non-infinite single precision floating point number. */ #ifndef _DECC_V4_SOURCE # if defined(_XOPEN_SOURCE) || !defined(_ANSI_C_SOURCE) # define MAXFLOAT __MAXFLOAT # endif #endif /* ** 4.5.2 Trigonometric Functions */ double acos (double __x); double asin (double __x); double atan (double __x); double atan2 (double __y, double __x); double cos (double __x); double sin (double __x); double tan (double __x); #ifdef __ALPHA float acosf (float __x); float asinf (float __x); float atanf (float __x); float atan2f (float __y, float __x); float cosf (float __x); float sinf (float __x); float tanf (float __x); long double acosl (long double __x); long double asinl (long double __x); long double atanl (long double __x); long double atan2l (long double __y, long double __x); long double cosl (long double __x); long double sinl (long double __x); long double tanl (long double __x); #endif /* ** 4.5.3 Hyperbolic Functions */ double cosh (double __x); double sinh (double __x); double tanh (double __x); #ifdef __ALPHA float coshf (float __x); float sinhf (float __x); float tanhf (float __x); long double coshl (long double __x); long double sinhl (long double __x); long double tanhl (long double __x); #endif /* ** 4.5.4 Exponential and Logarithmic Functions */ double exp (double __x); double frexp (double __value, int *__exp); double ldexp (double __x, int __exp); double log (double __x); double log10 (double __x); double modf (double __value, double *__iptr); #ifdef __ALPHA float expf (float __x); float frexpf (float __value, int *__exp); float ldexpf (float __x, int __exp); float logf (float __x); float log10f (float __x); float modff (float __value, float *__iptr); long double expl (long double __x); long double frexpl (long double __value, int *__exp); long double ldexpl (long double __x, int __exp); long double logl (long double __x); long double log10l (long double __x); long double modfl (long double __value, long double *__iptr); #endif /* ** 4.5.5 Power Functions */ double pow (double __x, double __y); double sqrt (double __x); #ifdef __ALPHA float powf (float __x, float __y); float sqrtf (float __x); long double powl (long double __x, long double __y); long double sqrtl (long double __x); #endif /* ** 4.5.6 Nearest Integer, Absolute Value, and Remainder Functions */ double ceil (double __x); double fabs (double __x); double floor (double __x); double fmod (double __x, double __y); #ifdef __ALPHA float ceilf (float __x); float fabsf (float __x); float floorf (float __x); float fmodf (float __x, float __y); long double ceill (long double __x); long double fabsl (long double __x); long double floorl (long double __x); long double fmodl (long double __x, long double __y); #endif #if defined(__ALPHA) && defined(__DECC) double __FABS (double __x); double __COS (double __x); double __SIN (double __x); # define fabs(__x) __FABS(__x) # define cos(__x) __COS(__x) # define sin(__x) __SIN(__x) #endif /* ** Define X/Open XPG4 extensions on both VAX and Alpha */ #if defined _XOPEN_SOURCE || !defined _ANSI_C_SOURCE double hypot (double __x, double __y); #endif /* ** X/Open XPG4 extensions on Alpha-only */ #if defined __ALPHA && (defined _XOPEN_SOURCE || !defined _ANSI_C_SOURCE) double erf (double __x); double erfc (double __x); double gamma (double __x); double j0 (double __x); double j1 (double __x); double jn (int __n, double __x); double lgamma (double __x); double y0 (double __x); double y1 (double __x); double yn (int __n , double __x); float erff (float __x); float erfcf (float __x); float gammaf (float __x); float hypotf (float __x, float __y); float lgammaf (float __x); float y0f (float __x); float y1f (float __x); float ynf (int __n , float __x); float j0f (float __x); float j1f (float __x); float jnf (int __n, float __x); long double erfl (long double __x); long double erfcl (long double __x); long double gammal (long double __x); long double hypotl (long double __x, long double __y); long double j0l (long double __x); long double j1l (long double __x); long double jnl (int __n, long double __x); long double lgammal (long double __x); long double y0l (long double __x); long double y1l (long double __x); long double ynl (int __n , long double __x); /* ** isnan() conflicts with isnan() macro in . */ # ifndef __FP_LOADED int isnan (double __x); # endif int isnanf (float __x); int isnanl (long double __x); # pragma __extern_model __save # pragma __extern_model __strict_refdef extern int signgam; # pragma __extern_model __restore #endif /* ** Define X/open XPG4 V2 extensions */ #if defined __ALPHA && (defined _XOPEN_SOURCE_EXTENDED || !defined _ANSI_C_SOURCE) double acosh (double __x); double asinh (double __x); double atanh (double __x); double cbrt (double __x); double expm1 (double __x); double logb (double __x); double log1p (double __x); double nextafter (double __x, double __y); double rint (double __x); double scalb (double __x, double __n); float acoshf (float __x); float asinhf (float __x); float atanhf (float __x); float cbrtf (float __x); float expm1f (float __x); float logbf (float __x); float log1pf (float __x); float nextafterf (float __x, float __y); float rintf (float __x); float scalbf (float __x, float __n); long double acoshl (long double __x); long double asinhl (long double __x); long double atanhl (long double __x); long double cbrtl (long double __x); long double expm1l (long double __x); long double logbl (long double __x); long double log1pl (long double __x); long double nextafterl (long double __x, long double __y); long double rintl (long double __x); long double scalbl (long double __x, long double __n); #endif /* ** Define DEC C Extensions both VAX and Alpha */ #ifndef _ANSI_C_SOURCE #ifndef __COMPLEX_LOADED # define _MATH_H_DEFINED_CABS 1 typedef struct { double x, y; } cabs_t; double cabs (cabs_t __z); #endif #endif /* ** DEC C Extensions, Alpha only */ #if defined __ALPHA && !defined _ANSI_C_SOURCE # ifndef __COMPLEX_LOADED # define _MATH_H_DEFINED_CABS 1 typedef struct { float x, y; } cabsf_t; typedef struct { long double x, y; } cabsl_t; float cabsf (cabsf_t __z); long double cabsl (cabsl_t __z); # endif double acosd (double __x); double asind (double __x); double atand (double __x); double atand2 (double __y, double __x); double copysign (double __x, double __y); double cosd (double __x); double cot (double __x); double cotd (double __x); double log2 (double __x); double nint (double __x); double sind (double __x); double tand (double __x); double trunc (double __x); float acosdf (float __x); float asindf (float __x); float atandf (float __x); float atand2f (float __y, float __x); float copysignf (float __x, float __y); float cosdf (float __x); float cotf (float __x); float cotdf (float __x); float log2f (float __x); float nintf (float __x); float sindf (float __x); float tandf (float __x); float truncf (float __x); long double acosdl (long double __x); long double asindl (long double __x); long double atandl (long double __x); long double atand2l (long double __y, long double __x); long double copysignl (long double __x, long double __y); long double cosdl (long double __x); long double cotl (long double __x); long double cotdl (long double __x); long double log2l (long double __x); long double nintl (long double __x); long double sindl (long double __x); long double tandl (long double __x); long double truncl (long double __x); int finite (double __x); int fp_class (double __x); int unordered (double __x, double __y); int finitef (float __x); int fp_classf (float __x); int unorderedf (float __x, float __y); int finitel (long double __x); int fp_classl (long double __x); int unorderedl (long double __x, long double __y); #endif #if defined _XOPEN_SOURCE || (!defined _DECC_V4_SOURCE && !defined _ANSI_C_SOURCE) #define M_E 2.7182818284590452354E0 /* e */ #define M_LOG2E 1.4426950408889634074E0 /* log2(e) */ #define M_LOG10E 4.3429448190325182765E-1 /* log10(e) */ #define M_LN2 6.9314718055994530942E-1 /* ln(2) */ #define M_LN10 2.3025850929940456840E0 /* ln(10) */ #define M_PI 3.1415926535897932385E0 /* pi */ #define M_PI_2 1.5707963267948966192E0 /* pi/2 */ #define M_PI_4 7.8539816339744830962E-1 /* pi/4 */ #define M_1_PI 3.1830988618379067154E-1 /* 1/pi */ #define M_2_PI 6.3661977236758134308E-1 /* 2/pi */ #define M_2_SQRTPI 1.1283791670955125739E0 /* 2/sqrt(pi) */ #define M_SQRT2 1.4142135623730950488E0 /* sqrt(2) */ #define M_SQRT1_2 7.0710678118654752440E-1 /* 1/sqrt(2) */ #endif /* ** DEC C V4.0 compatibility. These functions were defined in previous ** versions of DEC C and are retained for compatibility. */ #ifdef _DECC_V4_SOURCE # if __G_FLOAT double MTH$GCOS_R7 (double __x); double MTH$GSIN_R7 (double __x); # elif __IEEE_FLOAT double MTH$TCOS_R7 (double __x); double MTH$TSIN_R7 (double __x); # else double MTH$DCOS_R7 (double __x); double MTH$DSIN_R7 (double __x); # endif # define VAXC$TANH 1 #endif #ifdef __KAP #if defined(__ALPHA) && defined(__DECC) #pragma _KAP no side effects ( __FABS ) #pragma _KAP no side effects ( __COS ) #pragma _KAP no side effects ( __SIN ) #endif #pragma _KAP no side effects ( acos ) #pragma _KAP no side effects ( asin ) #pragma _KAP no side effects ( atan ) #pragma _KAP no side effects ( atan2 ) #pragma _KAP no side effects ( cos ) #pragma _KAP no side effects ( sin ) #pragma _KAP no side effects ( tan ) #pragma _KAP no side effects ( cosh ) #pragma _KAP no side effects ( sinh ) #pragma _KAP no side effects ( tanh ) #pragma _KAP no side effects ( exp ) #pragma _KAP no side effects ( frexp ) #pragma _KAP no side effects ( ldexp ) #pragma _KAP no side effects ( log ) #pragma _KAP no side effects ( log10 ) #pragma _KAP no side effects ( modf ) #pragma _KAP no side effects ( pow ) #pragma _KAP no side effects ( sqrt ) #pragma _KAP no side effects ( cabs ) #pragma _KAP no side effects ( hypot ) #pragma _KAP no side effects ( ceil ) #pragma _KAP no side effects ( fabs ) #pragma _KAP no side effects ( floor ) #pragma _KAP no side effects ( fmod ) #pragma _KAP no side effects ( acosf ) #pragma _KAP no side effects ( asinf ) #pragma _KAP no side effects ( atanf ) #pragma _KAP no side effects ( atan2f ) #pragma _KAP no side effects ( cosf ) #pragma _KAP no side effects ( sinf ) #pragma _KAP no side effects ( tanf ) #pragma _KAP no side effects ( coshf ) #pragma _KAP no side effects ( sinhf ) #pragma _KAP no side effects ( tanhf ) #pragma _KAP no side effects ( expf ) #pragma _KAP no side effects ( frexpf ) #pragma _KAP no side effects ( ldexpf ) #pragma _KAP no side effects ( logf ) #pragma _KAP no side effects ( log10f ) #pragma _KAP no side effects ( modff ) #pragma _KAP no side effects ( powf ) #pragma _KAP no side effects ( sqrtf ) #pragma _KAP no side effects ( cabsf ) #pragma _KAP no side effects ( hypotf ) #pragma _KAP no side effects ( ceilf ) #pragma _KAP no side effects ( fabsf ) #pragma _KAP no side effects ( floorf ) #pragma _KAP no side effects ( fmodf ) #pragma _KAP no side effects ( acosl ) #pragma _KAP no side effects ( asinl ) #pragma _KAP no side effects ( atanl ) #pragma _KAP no side effects ( atan2l ) #pragma _KAP no side effects ( cosl ) #pragma _KAP no side effects ( sinl ) #pragma _KAP no side effects ( tanl ) #pragma _KAP no side effects ( coshl ) #pragma _KAP no side effects ( sinhl ) #pragma _KAP no side effects ( tanhl ) #pragma _KAP no side effects ( expl ) #pragma _KAP no side effects ( frexpl ) #pragma _KAP no side effects ( ldexpl ) #pragma _KAP no side effects ( logl ) #pragma _KAP no side effects ( log10l ) #pragma _KAP no side effects ( modfl ) #pragma _KAP no side effects ( powl ) #pragma _KAP no side effects ( sqrtl ) #pragma _KAP no side effects ( cabsl ) #pragma _KAP no side effects ( hypotl ) #pragma _KAP no side effects ( ceill ) #pragma _KAP no side effects ( fabsl ) #pragma _KAP no side effects ( floorl ) #pragma _KAP no side effects ( fmodl ) #pragma _KAP no side effects ( erf ) #pragma _KAP no side effects ( erfc ) #pragma _KAP no side effects ( isnan ) #pragma _KAP no side effects ( j0 ) #pragma _KAP no side effects ( j1 ) #pragma _KAP no side effects ( jn ) #pragma _KAP no side effects ( y0 ) #pragma _KAP no side effects ( y1 ) #pragma _KAP no side effects ( yn ) #pragma _KAP no side effects ( erff ) #pragma _KAP no side effects ( erfcf ) #pragma _KAP no side effects ( isnanf ) #pragma _KAP no side effects ( j0f ) #pragma _KAP no side effects ( j1f ) #pragma _KAP no side effects ( jnf ) #pragma _KAP no side effects ( y0f ) #pragma _KAP no side effects ( y1f ) #pragma _KAP no side effects ( ynf ) #pragma _KAP no side effects ( erfl ) #pragma _KAP no side effects ( erfcl ) #pragma _KAP no side effects ( isnanl ) #pragma _KAP no side effects ( j0l ) #pragma _KAP no side effects ( j1l ) #pragma _KAP no side effects ( jnl ) #pragma _KAP no side effects ( y0l ) #pragma _KAP no side effects ( y1l ) #pragma _KAP no side effects ( ynl ) #pragma _KAP no side effects ( copysign ) #pragma _KAP no side effects ( finite ) #pragma _KAP no side effects ( fp_class ) #pragma _KAP no side effects ( nextafter ) #pragma _KAP no side effects ( unordered ) #pragma _KAP no side effects ( copysignf ) #pragma _KAP no side effects ( finitef ) #pragma _KAP no side effects ( fp_classf ) #pragma _KAP no side effects ( nextafterf ) #pragma _KAP no side effects ( unorderedf ) #pragma _KAP no side effects ( copysignl ) #pragma _KAP no side effects ( finitel ) #pragma _KAP no side effects ( fp_classl ) #pragma _KAP no side effects ( nextafterl ) #pragma _KAP no side effects ( unorderedl ) #pragma _KAP no side effects ( acosh ) #pragma _KAP no side effects ( asinh ) #pragma _KAP no side effects ( atanh ) #pragma _KAP no side effects ( acoshf ) #pragma _KAP no side effects ( asinhf ) #pragma _KAP no side effects ( atanhf ) #pragma _KAP no side effects ( acoshl ) #pragma _KAP no side effects ( asinhl ) #pragma _KAP no side effects ( atanhl ) #pragma _KAP no side effects ( cot ) #pragma _KAP no side effects ( cotd ) #pragma _KAP no side effects ( cotf ) #pragma _KAP no side effects ( cotdf ) #pragma _KAP no side effects ( cotl ) #pragma _KAP no side effects ( cotdl ) #pragma _KAP no side effects ( acosd ) #pragma _KAP no side effects ( asind ) #pragma _KAP no side effects ( atand ) #pragma _KAP no side effects ( atand2 ) #pragma _KAP no side effects ( cosd ) #pragma _KAP no side effects ( sind ) #pragma _KAP no side effects ( tand ) #pragma _KAP no side effects ( acosdf ) #pragma _KAP no side effects ( asindf ) #pragma _KAP no side effects ( atandf ) #pragma _KAP no side effects ( atand2f ) #pragma _KAP no side effects ( cosdf ) #pragma _KAP no side effects ( sindf ) #pragma _KAP no side effects ( tandf ) #pragma _KAP no side effects ( acosdl ) #pragma _KAP no side effects ( asindl ) #pragma _KAP no side effects ( atandl ) #pragma _KAP no side effects ( atand2l ) #pragma _KAP no side effects ( cosdl ) #pragma _KAP no side effects ( sindl ) #pragma _KAP no side effects ( tandl ) #pragma _KAP no side effects ( nint ) #pragma _KAP no side effects ( rint ) #pragma _KAP no side effects ( trunc ) #pragma _KAP no side effects ( nintf ) #pragma _KAP no side effects ( rintf ) #pragma _KAP no side effects ( truncf ) #pragma _KAP no side effects ( nintl ) #pragma _KAP no side effects ( rintl ) #pragma _KAP no side effects ( truncl ) #endif /* __KAP */ /* ** Math routines added in C99. ** On Alpha, Compaq C V6.4 or later will by default add a facility ** prefix to the external symbols for these routines in the same ** situations when it will pre-define __STDC_VERSION__ to 199901L. ** So declare them, even though not all of them may be implemented ** on the version of OpenVMS used at compile-time. */ #if defined(__ALPHA) && (defined(__DECC) && __DECC_VER >= 60400000) \ && __STDC_VERSION__ >= 199901L /* ** Some were already extensions, no harm in redeclaring them ** if they were previously declared. */ double acosh (double __x); double asinh (double __x); double atanh (double __x); double cbrt (double __x); double copysign (double __x, double __y); double expm1 (double __x); double log1p (double __x); double log2 (double __x); double logb (double __x); double nextafter (double __x, double __y); double rint (double __x); double trunc (double __x); float acoshf (float __x); float asinhf (float __x); float atanhf (float __x); float cbrtf (float __x); float copysignf (float __x, float __y); float expm1f (float __x); float log1pf (float __x); float log2f (float __x); float logbf (float __x); float nextafterf (float __x, float __y); float rintf (float __x); float truncf (float __x); long double acoshl (long double __x); long double asinhl (long double __x); long double atanhl (long double __x); long double cbrtl (long double __x); long double copysignl (long double __x, long double __y); long double expm1l (long double __x); long double log1pl (long double __x); long double log2l (long double __x); long double logbl (long double __x); long double nextafterl (long double __x, long double __y); long double rintl (long double __x); long double truncl (long double __x); double erf (double __x); double erfc (double __x); double hypot (double __x, double __y); double lgamma (double __x); float erfcf (float __x); float erff (float __x); float hypotf (float __x, float __y); float lgammaf (float __x); long double erfcl (long double __x); long double erfl (long double __x); long double hypotl (long double __x, long double __y); long double lgammal (long double __x); /* ** The rest are new to in Compaq C V6.4 */ double exp2(double __x); double fdim(double __x, double __y); double fma(double __x, double __y, double __z); double fmax(double __x, double __y); double fmin(double __x, double __y); double nearbyint(double __x); double nexttoward(double __x, long double __y); double remainder(double __x, double __y); double remquo(double __x, double __y, int *__quo); double round(double __x); double scalbln(double __x, long int __n); double scalbn(double __x, int __n); double tgamma(double __x); float exp2f(float __x); float fdimf(float __x, float __y); float fmaf(float __x, float __y, float __z); float fmaxf(float __x, float __y); float fminf(float __x, float __y); float nearbyintf(float __x); float nexttowardf(float __x, long double __y); float remainderf(float __x, float __y); float remquof(float __x, float __y, int *__quo); float roundf(float __x); float scalblnf(float __x, long int __n); float scalbnf(float __x, int __n); float tgammaf(float __x); long double exp2l(long double __x); long double fdiml(long double __x, long double __y); long double fmal(long double __x, long double __y, long double __z); long double fmaxl(long double __x, long double __y); long double fminl(long double __x, long double __y); long double nearbyintl(long double __x); long double nexttowardl(long double __x, long double __y); long double remainderl(long double __x, long double __y); long double remquol(long double __x, long double __y, int *__quo); long double roundl(long double __x); long double scalblnl(long double __x, long int __n); long double scalbnl(long double __x, int __n); long double tgammal(long double __x); int ilogb(double __x); int ilogbf(float __x); int ilogbl(long double __x); long int lrint(double __x); long int lrintf(float __x); long int lrintl(long double __x); long int lround(double __x); long int lroundf(float __x); long int lroundl(long double __x); long long int llrint(double __x); long long int llrintf(float __x); long long int llrintl(long double __x); long long int llround(double __x); long long int llroundf(float __x); long long int llroundl(long double __x); #endif /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __member_alignment __restore #pragma __standard #endif /* __MATH_LOADED */