]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/math.h
This commit was generated by cvs2svn to compensate for changes in r98247,
[FreeBSD/FreeBSD.git] / include / math.h
1 /*
2  * Copyright (c) 1985, 1990, 1993
3  *      The Regents of the University of California.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. All advertising materials mentioning features or use of this software
14  *    must display the following acknowledgement:
15  *      This product includes software developed by the University of
16  *      California, Berkeley and its contributors.
17  * 4. Neither the name of the University nor the names of its contributors
18  *    may be used to endorse or promote products derived from this software
19  *    without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  *
33  *      @(#)math.h      8.1 (Berkeley) 6/2/93
34  * $FreeBSD$
35  */
36
37 #ifndef _MATH_H_
38 #define _MATH_H_
39
40 #define HUGE_VAL        1e500                   /* IEEE: positive infinity */
41
42 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
43 #define HUGE    HUGE_VAL
44
45 #define M_E             2.7182818284590452354   /* e */
46 #define M_LOG2E         1.4426950408889634074   /* log 2e */
47 #define M_LOG10E        0.43429448190325182765  /* log 10e */
48 #define M_LN2           0.69314718055994530942  /* log e2 */
49 #define M_LN10          2.30258509299404568402  /* log e10 */
50 #define M_PI            3.14159265358979323846  /* pi */
51 #define M_PI_2          1.57079632679489661923  /* pi/2 */
52 #define M_PI_4          0.78539816339744830962  /* pi/4 */
53 #define M_1_PI          0.31830988618379067154  /* 1/pi */
54 #define M_2_PI          0.63661977236758134308  /* 2/pi */
55 #define M_2_SQRTPI      1.12837916709551257390  /* 2/sqrt(pi) */
56 #define M_SQRT2         1.41421356237309504880  /* sqrt(2) */
57 #define M_SQRT1_2       0.70710678118654752440  /* 1/sqrt(2) */
58 #endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
59
60 #include <sys/cdefs.h>
61
62 /*
63  * Most of these functions have the side effect of setting errno, except
64  * in the (broken) BSD libm, so they not declared as __pure2.
65  */
66 __BEGIN_DECLS
67 double  acos(double);
68 double  asin(double);
69 double  atan(double);
70 double  atan2(double, double);
71 double  ceil(double);
72 double  cos(double);
73 double  cosh(double);
74 double  exp(double);
75 double  fabs(double);
76 double  floor(double);
77 double  fmod(double, double);
78 double  frexp(double, int *);   /* fundamentally !__pure2 */
79 double  ldexp(double, int);
80 double  log(double);
81 double  log10(double);
82 double  modf(double, double *); /* fundamentally !__pure2 */
83 double  pow(double, double);
84 double  sin(double);
85 double  sinh(double);
86 double  sqrt(double);
87 double  tan(double);
88 double  tanh(double);
89
90 /*
91  * These functions are non-ANSI so they can be "right".  The ones that
92  * don't set errno in [lib]msun are declared as __pure2.
93  */
94 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
95 double  acosh(double);
96 double  asinh(double);
97 double  atanh(double);
98 double  cabs();         /* we can't describe cabs()'s argument properly */
99 double  cbrt(double) __pure2;
100 double  copysign(double, double) __pure2;
101 double  drem(double, double);
102 double  erf(double);
103 double  erfc(double) __pure2;
104 double  expm1(double) __pure2;
105 int     finite(double) __pure2;
106 double  hypot(double, double);
107 int     isinf(double) __pure2;
108 int     isnan(double) __pure2;
109 double  j0(double);
110 double  j1(double);
111 double  jn(int, double);
112 double  lgamma(double);
113 double  log1p(double) __pure2;
114 double  logb(double) __pure2;
115 double  rint(double) __pure2;
116 double  scalb(double, int);
117 double  y0(double);
118 double  y1(double);
119 double  yn(int, double);
120 #endif
121
122 __END_DECLS
123
124 #endif /* !_MATH_H_ */