home *** CD-ROM | disk | FTP | other *** search
- /***
- *math.h - definitions and declarations for math library
- *
- * Copyright (c) 1985-1991, Microsoft Corporation. All rights reserved.
- *
- *Purpose:
- * This file contains constant definitions and external subroutine
- * declarations for the math subroutine library.
- * [ANSI/System V]
- *
- ****/
-
- #ifndef _INC_MATH
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if defined(_DLL) && !defined(_MT)
- #error Cannot define _DLL without _MT
- #endif
-
- #ifdef _MT
- #define _FAR_ __far
- #else
- #define _FAR_
- #endif
-
- #if (_MSC_VER <= 600)
- #define __cdecl _cdecl
- #define __far _far
- #define __loadds _loadds
- #define __near _near
- #define __pascal _pascal
- #endif
-
- /* definition of _exception struct - this struct is passed to the matherr
- * routine when a floating point exception is detected
- */
-
- #ifndef _EXCEPTION_DEFINED
- #pragma pack(2)
-
- struct _exception {
- int type; /* exception type - see below */
- char _FAR_ *name; /* name of function where error occured */
- double arg1; /* first argument to function */
- double arg2; /* second argument (if any) to function */
- double retval; /* value to be returned by function */
- } ;
-
- #ifndef __STDC__
- /* Non-ANSI name for compatibility */
- struct exception {
- int type; /* exception type - see below */
- char _FAR_ *name; /* name of function where error occured */
- double arg1; /* first argument to function */
- double arg2; /* second argument (if any) to function */
- double retval; /* value to be returned by function */
- } ;
- #endif
-
- #pragma pack()
- #define _EXCEPTION_DEFINED
- #endif
-
-
- /* definition of a _complex struct to be used by those who use cabs and
- * want type checking on their argument
- */
-
- #ifndef _COMPLEX_DEFINED
-
- struct _complex {
- double x,y; /* real and imaginary parts */
- } ;
-
- #ifndef __STDC__
- /* Non-ANSI name for compatibility */
- struct complex {
- double x,y; /* real and imaginary parts */
- } ;
- #endif
-
- #define _COMPLEX_DEFINED
- #endif
-
-
- /* Constant definitions for the exception type passed in the _exception struct
- */
-
- #define _DOMAIN 1 /* argument domain error */
- #define _SING 2 /* argument singularity */
- #define _OVERFLOW 3 /* overflow range error */
- #define _UNDERFLOW 4 /* underflow range error */
- #define _TLOSS 5 /* total loss of precision */
- #define _PLOSS 6 /* partial loss of precision */
-
- #define EDOM 33
- #define ERANGE 34
-
-
- /* definitions of _HUGE (XENIX) and HUGE_VAL (ANSI) error return values used
- * by several floating point math routines
- */
-
- #ifndef _DLL
- extern double __near __cdecl _HUGE;
- #else
- extern double _FAR_ __cdecl _HUGE;
- #endif
- #define HUGE_VAL _HUGE
-
-
- /* function prototypes */
-
- #ifdef _MT /* function prototypes for _MT version */
- int _FAR_ __cdecl abs(int);
- double _FAR_ __pascal acos(double);
- double _FAR_ __pascal asin(double);
- double _FAR_ __pascal atan(double);
- double _FAR_ __pascal atan2(double, double);
- double _FAR_ __pascal atof(const char _FAR_ *);
- double _FAR_ __pascal _cabs(struct _complex);
- double _FAR_ __pascal ceil(double);
- double _FAR_ __pascal cos(double);
- double _FAR_ __pascal cosh(double);
- int _FAR_ __cdecl _dieeetomsbin(double _FAR_ *, double _FAR_ *);
- int _FAR_ __cdecl _dmsbintoieee(double _FAR_ *, double _FAR_ *);
- double _FAR_ __pascal exp(double);
- double _FAR_ __pascal fabs(double);
- int _FAR_ __cdecl _fieeetomsbin(float _FAR_ *, float _FAR_ *);
- double _FAR_ __pascal floor(double);
- double _FAR_ __pascal fmod(double, double);
- int _FAR_ __cdecl _fmsbintoieee(float _FAR_ *, float _FAR_ *);
- double _FAR_ __pascal frexp(double, int _FAR_ *);
- double _FAR_ __pascal _hypot(double, double);
- double _FAR_ __pascal _j0(double);
- double _FAR_ __pascal _j1(double);
- double _FAR_ __pascal _jn(int, double);
- long _FAR_ __cdecl labs(long);
- double _FAR_ __pascal ldexp(double, int);
- double _FAR_ __pascal log(double);
- double _FAR_ __pascal log10(double);
- int _FAR_ __cdecl _matherr(struct _exception _FAR_ *);
- double _FAR_ __pascal modf(double, double _FAR_ *);
- double _FAR_ __pascal pow(double, double);
- double _FAR_ __pascal sin(double);
- double _FAR_ __pascal sinh(double);
- double _FAR_ __pascal sqrt(double);
- double _FAR_ __pascal tan(double);
- double _FAR_ __pascal tanh(double);
- double _FAR_ __pascal _y0(double);
- double _FAR_ __pascal _y1(double);
- double _FAR_ __pascal _yn(int, double);
-
- #else /* function prototypes for non _MT version */
- int _FAR_ __cdecl abs(int);
- double _FAR_ __cdecl acos(double);
- double _FAR_ __cdecl asin(double);
- double _FAR_ __cdecl atan(double);
- double _FAR_ __cdecl atan2(double, double);
- double _FAR_ __cdecl atof(const char _FAR_ *);
- double _FAR_ __cdecl _cabs(struct _complex);
- double _FAR_ __cdecl ceil(double);
- double _FAR_ __cdecl cos(double);
- double _FAR_ __cdecl cosh(double);
- int _FAR_ __cdecl _dieeetomsbin(double _FAR_ *, double _FAR_ *);
- int _FAR_ __cdecl _dmsbintoieee(double _FAR_ *, double _FAR_ *);
- double _FAR_ __cdecl exp(double);
- double _FAR_ __cdecl fabs(double);
- int _FAR_ __cdecl _fieeetomsbin(float _FAR_ *, float _FAR_ *);
- double _FAR_ __cdecl floor(double);
- double _FAR_ __cdecl fmod(double, double);
- int _FAR_ __cdecl _fmsbintoieee(float _FAR_ *, float _FAR_ *);
- double _FAR_ __cdecl frexp(double, int _FAR_ *);
- double _FAR_ __cdecl _hypot(double, double);
- double _FAR_ __cdecl _j0(double);
- double _FAR_ __cdecl _j1(double);
- double _FAR_ __cdecl _jn(int, double);
- long _FAR_ __cdecl labs(long);
- double _FAR_ __cdecl ldexp(double, int);
- double _FAR_ __cdecl log(double);
- double _FAR_ __cdecl log10(double);
- int _FAR_ __cdecl _matherr(struct _exception _FAR_ *);
- double _FAR_ __cdecl modf(double, double _FAR_ *);
- double _FAR_ __cdecl pow(double, double);
- double _FAR_ __cdecl sin(double);
- double _FAR_ __cdecl sinh(double);
- double _FAR_ __cdecl sqrt(double);
- double _FAR_ __cdecl tan(double);
- double _FAR_ __cdecl tanh(double);
- double _FAR_ __cdecl _y0(double);
- double _FAR_ __cdecl _y1(double);
- double _FAR_ __cdecl _yn(int, double);
- #endif
-
-
- /* definition of _exceptionl struct - this struct is passed to the _matherrl
- * routine when a floating point exception is detected in a long double routine
- */
-
- #ifndef _LD_EXCEPTION_DEFINED
- #pragma pack(2)
- struct _exceptionl {
- int type; /* exception type - see below */
- char _FAR_ *name; /* name of function where error occured */
- long double arg1; /* first argument to function */
- long double arg2; /* second argument (if any) to function */
- long double retval; /* value to be returned by function */
- } ;
- #pragma pack()
- #define _LD_EXCEPTION_DEFINED
- #endif
-
-
- /* definition of a _complexl struct to be used by those who use _cabsl and
- * want type checking on their argument
- */
-
- #ifndef _LD_COMPLEX_DEFINED
- #pragma pack(2)
- struct _complexl {
- long double x,y; /* real and imaginary parts */
- } ;
- #pragma pack()
- #define _LD_COMPLEX_DEFINED
- #endif
-
- #ifndef _DLL
- extern long double __near __cdecl _LHUGE;
- #else /* _DLL */
- extern long double _FAR_ __cdecl _LHUGE;
- #endif /* _DLL */
- #define _LHUGE_VAL _LHUGE
-
-
- long double _FAR_ __cdecl acosl(long double);
- long double _FAR_ __cdecl asinl(long double);
- long double _FAR_ __cdecl atanl(long double);
- long double _FAR_ __cdecl atan2l(long double, long double);
- long double _FAR_ __cdecl _atold(const char _FAR_ *);
- long double _FAR_ __cdecl _cabsl(struct _complexl);
- long double _FAR_ __cdecl ceill(long double);
- long double _FAR_ __cdecl cosl(long double);
- long double _FAR_ __cdecl coshl(long double);
- long double _FAR_ __cdecl expl(long double);
- long double _FAR_ __cdecl fabsl(long double);
- long double _FAR_ __cdecl floorl(long double);
- long double _FAR_ __cdecl fmodl(long double, long double);
- long double _FAR_ __cdecl frexpl(long double, int _FAR_ *);
- long double _FAR_ __cdecl _hypotl(long double, long double);
- long double _FAR_ __cdecl _j0l(long double);
- long double _FAR_ __cdecl _j1l(long double);
- long double _FAR_ __cdecl _jnl(int, long double);
- long double _FAR_ __cdecl ldexpl(long double, int);
- long double _FAR_ __cdecl logl(long double);
- long double _FAR_ __cdecl log10l(long double);
- int _FAR_ __cdecl _matherrl(struct _exceptionl _FAR_ *);
- long double _FAR_ __cdecl modfl(long double, long double _FAR_ *);
- long double _FAR_ __cdecl powl(long double, long double);
- long double _FAR_ __cdecl sinl(long double);
- long double _FAR_ __cdecl sinhl(long double);
- long double _FAR_ __cdecl sqrtl(long double);
- long double _FAR_ __cdecl tanl(long double);
- long double _FAR_ __cdecl tanhl(long double);
- long double _FAR_ __cdecl _y0l(long double);
- long double _FAR_ __cdecl _y1l(long double);
- long double _FAR_ __cdecl _ynl(int, long double);
-
-
- #ifndef __STDC__
- /* Non-ANSI names for compatibility */
-
- #define DOMAIN _DOMAIN
- #define SING _SING
- #define OVERFLOW _OVERFLOW
- #define UNDERFLOW _UNDERFLOW
- #define TLOSS _TLOSS
- #define PLOSS _PLOSS
-
- #ifndef _DLL
- extern double __near __cdecl HUGE;
- #else
- extern double _FAR_ __cdecl HUGE;
- #endif
-
- #ifdef _MT
- double _FAR_ __pascal cabs(struct complex);
- double _FAR_ __pascal hypot(double, double);
- double _FAR_ __pascal j0(double);
- double _FAR_ __pascal j1(double);
- double _FAR_ __pascal jn(int, double);
- double _FAR_ __pascal y0(double);
- double _FAR_ __pascal y1(double);
- double _FAR_ __pascal yn(int, double);
- #else
- double _FAR_ __cdecl cabs(struct complex);
- double _FAR_ __cdecl hypot(double, double);
- double _FAR_ __cdecl j0(double);
- double _FAR_ __cdecl j1(double);
- double _FAR_ __cdecl jn(int, double);
- double _FAR_ __cdecl y0(double);
- double _FAR_ __cdecl y1(double);
- double _FAR_ __cdecl yn(int, double);
- #endif
-
- int _FAR_ __cdecl dieeetomsbin(double _FAR_ *, double _FAR_ *);
- int _FAR_ __cdecl dmsbintoieee(double _FAR_ *, double _FAR_ *);
- int _FAR_ __cdecl fieeetomsbin(float _FAR_ *, float _FAR_ *);
- int _FAR_ __cdecl fmsbintoieee(float _FAR_ *, float _FAR_ *);
- int _FAR_ __cdecl matherr(struct exception _FAR_ *);
-
- long double _FAR_ __cdecl cabsl(struct _complexl);
- long double _FAR_ __cdecl hypotl(long double, long double);
-
- #endif /* __STDC__ */
-
-
- #ifdef __cplusplus
- }
- #endif
-
- #define _INC_MATH
- #endif /* _INC_MATH */
-