1
/* Copyright (c) 2002, Michael Stumpf
3
Portions of documentation Copyright (c) 1990 - 1994
4
The Regents of the University of California.
8
Redistribution and use in source and binary forms, with or without
9
modification, are permitted provided that the following conditions are met:
11
* Redistributions of source code must retain the above copyright
12
notice, this list of conditions and the following disclaimer.
14
* Redistributions in binary form must reproduce the above copyright
15
notice, this list of conditions and the following disclaimer in
16
the documentation and/or other materials provided with the
19
* Neither the name of the copyright holders nor the names of
20
contributors may be used to endorse or promote products derived
21
from this software without specific prior written permission.
23
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
POSSIBILITY OF SUCH DAMAGE. */
35
/* $Id: math.h,v 1.5 2004/11/10 20:07:12 arcanum Exp $ */
2
38
math.h - mathematical functions
37
extern double fmod(double, double) __ATTR_CONST__;
38
extern double modf(double, double *);
39
extern double sin(double) __ATTR_CONST__;
40
extern double sqrt(double) __ATTR_CONST__;
41
extern double tan(double) __ATTR_CONST__;
42
extern double floor(double) __ATTR_CONST__;
43
extern double ceil(double) __ATTR_CONST__;
44
extern double frexp(double, int *);
45
extern double ldexp(double,int) __ATTR_CONST__;
46
extern double exp(double) __ATTR_CONST__;
47
extern double cosh(double) __ATTR_CONST__;
48
extern double sinh(double) __ATTR_CONST__;
49
extern double tanh(double) __ATTR_CONST__;
50
extern double acos(double) __ATTR_CONST__;
51
extern double asin(double) __ATTR_CONST__;
52
extern double atan(double) __ATTR_CONST__;
53
extern double atan2(double, double) __ATTR_CONST__;
54
extern double log(double) __ATTR_CONST__;
55
extern double log10(double) __ATTR_CONST__;
56
extern double pow(double, double) __ATTR_CONST__;
57
extern double strtod(const char *s, char **endptr);
59
/* non-standard functions */
60
extern double square(double) __ATTR_CONST__;
115
The function fmod() returns the floating-point
116
remainder of <tt>x / y</tt>.
118
extern double fmod(double __x, double __y) __ATTR_CONST__;
123
The modf() function breaks the argument \c value into integral and
124
fractional parts, each of which has the same sign as the
125
argument. It stores the integral part as a double in the object
126
pointed to by \c iptr.
128
The modf() function returns the signed fractional part of \c value.
130
extern double modf(double __value, double *__iptr);
135
The sin() function returns the sine of \c x, measured in
138
extern double sin(double __x) __ATTR_CONST__;
143
The sqrt() function returns the non-negative square root of \c x.
145
extern double sqrt(double __x) __ATTR_CONST__;
150
The tan() function returns the tangent of \c x, measured in
153
extern double tan(double __x) __ATTR_CONST__;
158
The floor() function returns the largest integral value
159
less than or equal to \c x, expressed as a floating-point number.
161
extern double floor(double __x) __ATTR_CONST__;
166
The ceil() function returns the smallest integral value
167
greater than or equal to \c x, expressed as a floating-point number.
169
extern double ceil(double __x) __ATTR_CONST__;
174
The frexp() function breaks a floating-point number into a normalized
175
fraction and an integral power of 2. It stores the integer in the \c int
176
object pointed to by \c exp.
178
The frexp() function returns the value \c x, such that \c x is a double with
179
magnitude in the interval [1/2, 1) or zero, and \c value equals \c x times 2
180
raised to the power \c *exp. If value is zero, both parts of the result are
183
extern double frexp(double __value, int *__exp);
188
The ldexp() function multiplies a floating-point number by an integral
191
The ldexp() function returns the value of \c x times 2 raised to the power
194
If the resultant value would cause an overflow, the global variable errno
195
is set to ERANGE, and the value NaN is returned.
197
extern double ldexp(double __x, int __exp) __ATTR_CONST__;
202
The exp() function returns the exponential value of \c x.
204
extern double exp(double _x) __ATTR_CONST__;
209
The cosh() function returns the hyperbolic cosine of \c x.
211
extern double cosh(double __x) __ATTR_CONST__;
216
The sinh() function returns the hyperbolic sine of \c x.
218
extern double sinh(double __x) __ATTR_CONST__;
223
The tanh() function returns the hyperbolic tangent of \c x.
225
extern double tanh(double __x) __ATTR_CONST__;
230
The acos() function computes the principal value of the
231
arc cosine of \c x. The returned value is in the range
233
A domain error occurs for arguments not in the range
236
extern double acos(double __x) __ATTR_CONST__;
241
The asin() function computes the principal value of the
242
arc sine of \c x. The returned value is in the range
244
A domain error occurs for arguments not in the range
247
extern double asin(double __x) __ATTR_CONST__;
252
The atan() function computes the principal value of the
253
arc tangent of \c x. The returned value is in the range
255
A domain error occurs for arguments not in the range
258
extern double atan(double __x) __ATTR_CONST__;
262
The atan2() function computes the principal value of the
263
arc tangent of <tt>y / x</tt>, using the signs of both arguments
264
to determine the quadrant of the return value. The returned
265
value is in the range [-pi, +pi] radians.
266
If both \c x and \c y are zero, the global variable \c errno
269
extern double atan2(double __y, double __x) __ATTR_CONST__;
274
The log() function returns the natural logarithm of argument \c x.
276
If the argument is less than or equal 0, a domain error will occur.
278
extern double log(double __x) __ATTR_CONST__;
283
The log() function returns the logarithm of argument \c x to base 10.
285
If the argument is less than or equal 0, a domain error will occur.
287
extern double log10(double __x) __ATTR_CONST__;
292
The function pow() returns the value of \c x to the exponent \c y.
294
extern double pow(double __x, double __y) __ATTR_CONST__;
299
The function isnan() returns 1 if the argument \c x represents a
300
"not-a-number" (NaN) object, otherwise 0.
302
extern int isnan(double __x) __ATTR_CONST__;
307
The function isinf() returns 1 if the argument \c x is either
308
positive or negative infinity, otherwise 0.
310
extern int isinf(double __x) __ATTR_CONST__;
315
The function square() returns <tt>x * x</tt>.
318
This function does not belong to the C standard definition.
320
extern double square(double __x) __ATTR_CONST__;
324
The function inverse() returns <tt>1 / x</tt>.
327
This function does not belong to the C standard definition.
61
329
extern double inverse(double) __ATTR_CONST__;
63
331
#ifdef __cplusplus