Home | History | Annotate | Line # | Download | only in include
math.h revision 1.1
      1  1.1  cgd /*
      2  1.1  cgd  * Copyright (c) 1985, 1990 The Regents of the University of California.
      3  1.1  cgd  * All rights reserved.
      4  1.1  cgd  *
      5  1.1  cgd  * Redistribution and use in source and binary forms, with or without
      6  1.1  cgd  * modification, are permitted provided that the following conditions
      7  1.1  cgd  * are met:
      8  1.1  cgd  * 1. Redistributions of source code must retain the above copyright
      9  1.1  cgd  *    notice, this list of conditions and the following disclaimer.
     10  1.1  cgd  * 2. Redistributions in binary form must reproduce the above copyright
     11  1.1  cgd  *    notice, this list of conditions and the following disclaimer in the
     12  1.1  cgd  *    documentation and/or other materials provided with the distribution.
     13  1.1  cgd  * 3. All advertising materials mentioning features or use of this software
     14  1.1  cgd  *    must display the following acknowledgement:
     15  1.1  cgd  *	This product includes software developed by the University of
     16  1.1  cgd  *	California, Berkeley and its contributors.
     17  1.1  cgd  * 4. Neither the name of the University nor the names of its contributors
     18  1.1  cgd  *    may be used to endorse or promote products derived from this software
     19  1.1  cgd  *    without specific prior written permission.
     20  1.1  cgd  *
     21  1.1  cgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     22  1.1  cgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23  1.1  cgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24  1.1  cgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     25  1.1  cgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     26  1.1  cgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     27  1.1  cgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     28  1.1  cgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     29  1.1  cgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     30  1.1  cgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     31  1.1  cgd  * SUCH DAMAGE.
     32  1.1  cgd  *
     33  1.1  cgd  *	@(#)math.h	5.8 (Berkeley) 4/2/91
     34  1.1  cgd  */
     35  1.1  cgd 
     36  1.1  cgd #ifndef	_MATH_H_
     37  1.1  cgd #define	_MATH_H_
     38  1.1  cgd 
     39  1.1  cgd #if defined(vax) || defined(tahoe)		/* DBL_MAX from float.h */
     40  1.1  cgd #define	HUGE_VAL	1.701411834604692294E+38
     41  1.1  cgd #else
     42  1.1  cgd #define	HUGE_VAL	1e500			/* IEEE: positive infinity */
     43  1.1  cgd #endif
     44  1.1  cgd 
     45  1.1  cgd #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
     46  1.1  cgd #if defined(vax) || defined(tahoe)
     47  1.1  cgd /*
     48  1.1  cgd  * HUGE for the VAX and Tahoe converts to the largest possible F-float value.
     49  1.1  cgd  * This implies an understanding of the conversion behavior of atof(3).  It
     50  1.1  cgd  * was defined to be the largest float so that overflow didn't occur when it
     51  1.1  cgd  * was assigned to a single precision number.  HUGE_VAL is strongly preferred.
     52  1.1  cgd  */
     53  1.1  cgd #define	HUGE	1.701411733192644270E+38
     54  1.1  cgd #else
     55  1.1  cgd #define	HUGE	HUGE_VAL
     56  1.1  cgd #endif
     57  1.1  cgd #endif
     58  1.1  cgd 
     59  1.1  cgd #define	M_E		2.7182818284590452354	/* e */
     60  1.1  cgd #define	M_LOG2E		1.4426950408889634074	/* log 2e */
     61  1.1  cgd #define	M_LOG10E	0.43429448190325182765	/* log 10e */
     62  1.1  cgd #define	M_LN2		0.69314718055994530942	/* log e2 */
     63  1.1  cgd #define	M_LN10		2.30258509299404568402	/* log e10 */
     64  1.1  cgd #define	M_PI		3.14159265358979323846	/* pi */
     65  1.1  cgd #define	M_PI_2		1.57079632679489661923	/* pi/2 */
     66  1.1  cgd #define	M_PI_4		0.78539816339744830962	/* pi/4 */
     67  1.1  cgd #define	M_1_PI		0.31830988618379067154	/* 1/pi */
     68  1.1  cgd #define	M_2_PI		0.63661977236758134308	/* 2/pi */
     69  1.1  cgd #define	M_2_SQRTPI	1.12837916709551257390	/* 2/sqrt(pi) */
     70  1.1  cgd #define	M_SQRT2		1.41421356237309504880	/* sqrt(2) */
     71  1.1  cgd #define	M_SQRT1_2	0.70710678118654752440	/* 1/sqrt(2) */
     72  1.1  cgd 
     73  1.1  cgd #include <sys/cdefs.h>
     74  1.1  cgd 
     75  1.1  cgd __BEGIN_DECLS
     76  1.1  cgd double	acos __P((double));
     77  1.1  cgd double	asin __P((double));
     78  1.1  cgd double	atan __P((double));
     79  1.1  cgd double	atan2 __P((double, double));
     80  1.1  cgd double	ceil __P((double));
     81  1.1  cgd double	cos __P((double));
     82  1.1  cgd double	cosh __P((double));
     83  1.1  cgd double	exp __P((double));
     84  1.1  cgd double	fabs __P((double));
     85  1.1  cgd double	floor __P((double));
     86  1.1  cgd double	fmod __P((double, double));
     87  1.1  cgd double	frexp __P((double, int *));
     88  1.1  cgd double	ldexp __P((double, int));
     89  1.1  cgd double	log __P((double));
     90  1.1  cgd double	log10 __P((double));
     91  1.1  cgd double	modf __P((double, double *));
     92  1.1  cgd double	pow __P((double, double));
     93  1.1  cgd double	sin __P((double));
     94  1.1  cgd double	sinh __P((double));
     95  1.1  cgd double	sqrt __P((double));
     96  1.1  cgd double	tan __P((double));
     97  1.1  cgd double	tanh __P((double));
     98  1.1  cgd 
     99  1.1  cgd #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
    100  1.1  cgd double	acosh __P((double));
    101  1.1  cgd double	asinh __P((double));
    102  1.1  cgd double	atanh __P((double));
    103  1.1  cgd double	cabs();		/* we can't describe cabs()'s argument properly */
    104  1.1  cgd double	cbrt __P((double));
    105  1.1  cgd double	copysign __P((double, double));
    106  1.1  cgd double	drem __P((double, double));
    107  1.1  cgd double	erf __P((double));
    108  1.1  cgd double	erfc __P((double));
    109  1.1  cgd double	expm1 __P((double));
    110  1.1  cgd int	finite __P((double));
    111  1.1  cgd double	hypot __P((double, double));
    112  1.1  cgd #if defined(vax) || defined(tahoe)
    113  1.1  cgd double	infnan __P((int));
    114  1.1  cgd #endif
    115  1.1  cgd int	isinf __P((double));
    116  1.1  cgd int	isnan __P((double));
    117  1.1  cgd double	j0 __P((double));
    118  1.1  cgd double	j1 __P((double));
    119  1.1  cgd double	jn __P((int, double));
    120  1.1  cgd double	lgamma __P((double));
    121  1.1  cgd double	log1p __P((double));
    122  1.1  cgd double	logb __P((double));
    123  1.1  cgd double	rint __P((double));
    124  1.1  cgd double	scalb __P((double, int));
    125  1.1  cgd double	y0 __P((double));
    126  1.1  cgd double	y1 __P((double));
    127  1.1  cgd double	yn __P((int, double));
    128  1.1  cgd #endif
    129  1.1  cgd 
    130  1.1  cgd __END_DECLS
    131  1.1  cgd 
    132  1.1  cgd #endif /* _MATH_H_ */
    133