xref: /original-bsd/include/math.h (revision 7bad34b3)
1 /*
2  * Copyright (c) 1985, 1990 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)math.h	5.8 (Berkeley) 04/02/91
8  */
9 
10 #ifndef	_MATH_H_
11 #define	_MATH_H_
12 
13 #if defined(vax) || defined(tahoe)		/* DBL_MAX from float.h */
14 #define	HUGE_VAL	1.701411834604692294E+38
15 #else
16 #define	HUGE_VAL	1e500			/* IEEE: positive infinity */
17 #endif
18 
19 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
20 #if defined(vax) || defined(tahoe)
21 /*
22  * HUGE for the VAX and Tahoe converts to the largest possible F-float value.
23  * This implies an understanding of the conversion behavior of atof(3).  It
24  * was defined to be the largest float so that overflow didn't occur when it
25  * was assigned to a single precision number.  HUGE_VAL is strongly preferred.
26  */
27 #define	HUGE	1.701411733192644270E+38
28 #else
29 #define	HUGE	HUGE_VAL
30 #endif
31 #endif
32 
33 #define	M_E		2.7182818284590452354	/* e */
34 #define	M_LOG2E		1.4426950408889634074	/* log 2e */
35 #define	M_LOG10E	0.43429448190325182765	/* log 10e */
36 #define	M_LN2		0.69314718055994530942	/* log e2 */
37 #define	M_LN10		2.30258509299404568402	/* log e10 */
38 #define	M_PI		3.14159265358979323846	/* pi */
39 #define	M_PI_2		1.57079632679489661923	/* pi/2 */
40 #define	M_PI_4		0.78539816339744830962	/* pi/4 */
41 #define	M_1_PI		0.31830988618379067154	/* 1/pi */
42 #define	M_2_PI		0.63661977236758134308	/* 2/pi */
43 #define	M_2_SQRTPI	1.12837916709551257390	/* 2/sqrt(pi) */
44 #define	M_SQRT2		1.41421356237309504880	/* sqrt(2) */
45 #define	M_SQRT1_2	0.70710678118654752440	/* 1/sqrt(2) */
46 
47 #include <sys/cdefs.h>
48 
49 __BEGIN_DECLS
50 double	acos __P((double));
51 double	asin __P((double));
52 double	atan __P((double));
53 double	atan2 __P((double, double));
54 double	ceil __P((double));
55 double	cos __P((double));
56 double	cosh __P((double));
57 double	exp __P((double));
58 double	fabs __P((double));
59 double	floor __P((double));
60 double	fmod __P((double, double));
61 double	frexp __P((double, int *));
62 double	ldexp __P((double, int));
63 double	log __P((double));
64 double	log10 __P((double));
65 double	modf __P((double, double *));
66 double	pow __P((double, double));
67 double	sin __P((double));
68 double	sinh __P((double));
69 double	sqrt __P((double));
70 double	tan __P((double));
71 double	tanh __P((double));
72 
73 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
74 double	acosh __P((double));
75 double	asinh __P((double));
76 double	atanh __P((double));
77 double	cabs();		/* we can't describe cabs()'s argument properly */
78 double	cbrt __P((double));
79 double	copysign __P((double, double));
80 double	drem __P((double, double));
81 double	erf __P((double));
82 double	erfc __P((double));
83 double	expm1 __P((double));
84 int	finite __P((double));
85 double	hypot __P((double, double));
86 #if defined(vax) || defined(tahoe)
87 double	infnan __P((int));
88 #endif
89 int	isinf __P((double));
90 int	isnan __P((double));
91 double	j0 __P((double));
92 double	j1 __P((double));
93 double	jn __P((int, double));
94 double	lgamma __P((double));
95 double	log1p __P((double));
96 double	logb __P((double));
97 double	rint __P((double));
98 double	scalb __P((double, int));
99 double	y0 __P((double));
100 double	y1 __P((double));
101 double	yn __P((int, double));
102 #endif
103 
104 __END_DECLS
105 
106 #endif /* _MATH_H_ */
107