START-INFO-DIR-ENTRY * libm:: An ANSI-C conforming mathematical library. END-INFO-DIR-ENTRY
This file documents an ANSI-C conforming mathematical subroutine library.
Copyright (C) 1992, 1993, 1995 Cygnus Support
libm
includes software developed at SunPro, a Sun Microsystems,
Inc. business. Permission to use, copy, modify, and distribute this
software is freely granted, provided that this notice is preserved.
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, subject to the terms of the GNU General Public License, which includes the provision that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
libm/math.h
)This chapter groups a wide variety of mathematical functions. The
corresponding definitions and declarations are in libm/math.h
.
If you want to use these functions with programs which
#include <math.h>
, you need to define the symbol
_USE_LIBM_MATH_H
at compile time, e.g. via the compiler option
-D_USE_LIBM_MATH_H
.
Two definitions from libm/math.h
are of particular interest.
double
is defined as
HUGE_VAL
; this number is returned on overflow by many functions.
exception
is used when you write customized error
handlers for the mathematical functions. You can customize error
handling for most of these functions by defining your own version of
matherr
; see the section on matherr
for details.
Alternative declarations of the mathematical functions, which exploit
specific machine capabilities to operate faster--but generally have
less error checking and may reflect additional limitations--are
available when you include math.h
instead of libm/math.h
.
There are four different versions of the math library routines: IEEE,
POSIX, X/Open, or SVID. The version may be selected at runtime by
setting the global variable _LIB_VERSION
, defined in
libm/math.h
, to one of the following constants: _IEEE_
,
_POSIX_
, _XOPEN_
, or _SVID_
. (With reentrant C
libraries like the Cygnus C library, the _LIB_VERSION
variable is
not specific to any thread, and changing it will affect all threads.)
The versions of the library differ only in how errors are handled.
In IEEE mode, the matherr
function is never called, no warning
messages are printed, and errno
is never set.
In POSIX mode, errno
is set correctly, but the matherr
function is never called and no warning messages are printed.
In X/Open mode, errno
is set correctly, and matherr
is
called, but warning messages are not printed.
In SVID mode, functions which overflow return 3.40282346638528860e+38,
the maximum single precision floating point value, rather than infinity.
Also, errno
is set correctly, matherr
is called, and, if
matherr
returns 0, warning messages are printed for some errors.
For example, by default log(-1.0)
writes this message on standard
error output:
log: DOMAIN error
The library is set to X/Open mode by default.
acos
, acosf
--arc cosine#include <math.h> double acos(double x); float acosf(float x);
acos
computes the inverse cosine (arc cosine) of the input value.
Arguments to acos
must be in the range -1 to 1.
acosf
is identical to acos
, except that it performs
its calculations on floats
.
acos
and acosf
return values in radians, in the range of 0 to pi.
If x is not between -1 and 1, the returned value is NaN
(not a number) the global variable errno
is set to EDOM
, and a
DOMAIN error
message is sent as standard error output.
You can modify error handling for these functions using matherr
.
acosh
, acoshf
--inverse hyperbolic cosine#include <math.h> double acosh(double x); float acoshf(float x);
acosh
calculates the inverse hyperbolic cosine of x.
acosh
is defined as
log(x + sqrt(x*x-1))
x must be a number greater than or equal to 1.
acoshf
is identical, other than taking and returning floats.
acosh
and acoshf
return the calculated value. If x
less than 1, the return value is NaN and errno
is set to EDOM
.
You can change the error-handling behavior with the non-ANSI
matherr
function.
Neither acosh
nor acoshf
are ANSI C. They are not recommended
for portable programs.
asin
, asinf
--arc sine#include <math.h> double asin(double x); float asinf(float x);
asin
computes the inverse sine (arc sine) of the argument x.
Arguments to asin
must be in the range -1 to 1.
asinf
is identical to asin
, other than taking and
returning floats.
You can modify error handling for these routines using matherr
.
asin
returns values in radians, in the range of -pi/2 to pi/2.
If x is not in the range -1 to 1, asin
and asinf
return NaN (not a number), set the global variable errno
to
EDOM
, and issue a DOMAIN error
message.
You can change this error treatment using matherr
.
asinh
, asinhf
--inverse hyperbolic sine#include <math.h> double asinh(double x); float asinhf(float x);
asinh
calculates the inverse hyperbolic sine of x.
asinh
is defined as
sgn(x) * log(abs(x) + sqrt(1+x*x))
asinhf
is identical, other than taking and returning floats.
asinh
and asinhf
return the calculated value.
Neither asinh
nor asinhf
are ANSI C.
atan
, atanf
--arc tangent#include <math.h> double atan(double x); float atanf(float x);
atan
computes the inverse tangent (arc tangent) of the input value.
atanf
is identical to atan
, save that it operates on floats
.
atan
returns a value in radians, in the range of -pi/2 to pi/2.
atan
is ANSI C. atanf
is an extension.
atan2
, atan2f
--arc tangent of y/x#include <math.h> double atan2(double y,double x); float atan2f(float y,float x);
atan2
computes the inverse tangent (arc tangent) of y/x.
atan2
produces the correct result even for angles near
pi/2 or -pi/2
(that is, when x is near 0).
atan2f
is identical to atan2
, save that it takes and returns
float
.
atan2
and atan2f
return a value in radians, in the range of
-pi to pi.
If both x and y are 0.0, atan2
causes a DOMAIN
error.
You can modify error handling for these functions using matherr
.
atan2
is ANSI C. atan2f
is an extension.
atanh
, atanhf
--inverse hyperbolic tangent#include <math.h> double atanh(double x); float atanhf(float x);
atanh
calculates the inverse hyperbolic tangent of x.
atanhf
is identical, other than taking and returning
float
values.
atanh
and atanhf
return the calculated value.
If
|x|
is greater than 1, the global errno
is set to EDOM
and
the result is a NaN. A DOMAIN error
is reported.
If
|x|
is 1, the global errno
is set to EDOM
; and the result is
infinity with the same sign as x
. A SING error
is reported.
You can modify the error handling for these routines using
matherr
.
Neither atanh
nor atanhf
are ANSI C.
jN
,jNf
,yN
,yNf
--Bessel functions#include <math.h> double j0(double x); float j0f(float x); double j1(double x); float j1f(float x); double jn(int n, double x); float jnf(int n, float x); double y0(double x); float y0f(float x); double y1(double x); float y1f(float x); double yn(int n, double x); float ynf(int n, float x);
The Bessel functions are a family of functions that solve the differential equation
2 2 2 x y'' + xy' + (x - p )y = 0These functions have many applications in engineering and physics.
jn
calculates the Bessel function of the first kind of order
n. j0
and j1
are special cases for order 0 and order
1 respectively.
Similarly, yn
calculates the Bessel function of the second kind of
order n, and y0
and y1
are special cases for order 0 and
1.
jnf
, j0f
, j1f
, ynf
, y0f
, and y1f
perform the
same calculations, but on float
rather than double
values.
The value of each Bessel function at x is returned.
None of the Bessel functions are in ANSI C.
cbrt
, cbrtf
--cube root#include <math.h> double cbrt(double x); float cbrtf(float x);
cbrt
computes the cube root of the argument.
The cube root is returned.
cbrt
is in System V release 4. cbrtf
is an extension.
copysign
, copysignf
--sign of y, magnitude of x#include <math.h> double copysign (double x, double y); float copysignf (float x, float y);
copysign
constructs a number with the magnitude (absolute value)
of its first argument, x, and the sign of its second argument,
y.
copysignf
does the same thing; the two functions differ only in
the type of their arguments and result.
copysign
returns a double
with the magnitude of
x and the sign of y.
copysignf
returns a float
with the magnitude of
x and the sign of y.
copysign
is not required by either ANSI C or the System V Interface
Definition (Issue 2).
cosh
, coshf
--hyperbolic cosine#include <math.h> double cosh(double x); float coshf(float x)
cosh
computes the hyperbolic cosine of the argument x.
cosh(x)
is defined as
(exp(x) + exp(-x))/2
Angles are specified in radians.
coshf
is identical, save that it takes and returns float
.
The computed value is returned. When the correct value would create
an overflow, cosh
returns the value HUGE_VAL
with the
appropriate sign, and the global value errno
is set to ERANGE
.
You can modify error handling for these functions using the
function matherr
.
cosh
is ANSI.
coshf
is an extension.
erf
, erff
, erfc
, erfcf
--error function#include <math.h> double erf(double x); float erff(float x); double erfc(double x); float erfcf(float x);
erf
calculates an approximation to the "error function",
which estimates the probability that an observation will fall within
x standard deviations of the mean (assuming a normal
distribution).
erfc
calculates the complementary probability; that is,
erfc(x)
is 1 - erf(x)
. erfc
is computed directly,
so that you can use it to avoid the loss of precision that would
result from subtracting large probabilities (on large x) from 1.
erff
and erfcf
differ from erf
and erfc
only in the
argument and result types.
For positive arguments, erf
and all its variants return a
probability--a number between 0 and 1.
None of the variants of erf
are ANSI C.
exp
, expf
--exponential#include <math.h> double exp(double x); float expf(float x);
exp
and expf
calculate the exponential of x, that is,
e raised to the power x (where e
is the base of the natural system of logarithms, approximately 2.71828).
You can use the (non-ANSI) function matherr
to specify
error handling for these functions.
On success, exp
and expf
return the calculated value.
If the result underflows, the returned value is 0
. If the
result overflows, the returned value is HUGE_VAL
. In
either case, errno
is set to ERANGE
.
exp
is ANSI C. expf
is an extension.
expm1
, expm1f
--exponential minus 1#include <math.h> double expm1(double x); float expm1f(float x);
expm1
and expm1f
calculate the exponential of x
and subtract 1, that is,
e raised to the power x minus 1 (where e
is the base of the natural system of logarithms, approximately
2.71828). The result is accurate even for small values of
x, where using exp(x)-1
would lose many
significant digits.
e raised to the power x, minus 1.
Neither expm1
nor expm1f
is required by ANSI C or by
the System V Interface Definition (Issue 2).
fabs
, fabsf
--absolute value (magnitude)#include <math.h> double fabs(double x); float fabsf(float x);
fabs
and fabsf
calculate
the absolute value (magnitude) of the argument x, by direct
manipulation of the bit representation of x.
The calculated value is returned. No errors are detected.
fabs
is ANSI.
fabsf
is an extension.
floor
, floorf
, ceil
, ceilf
--floor and ceiling#include <math.h> double floor(double x); float floorf(float x); double ceil(double x); float ceilf(float x);
floor
and floorf
find
the nearest integer less than or equal to x.
ceil
and ceilf
find
the nearest integer greater than or equal to x.
floor
and ceil
return the integer result as a double.
floorf
and ceilf
return the integer result as a float.
floor
and ceil
are ANSI.
floorf
and ceilf
are extensions.
fmod
, fmodf
--floating-point remainder (modulo)#include <math.h> double fmod(double x, double y) float fmodf(float x, float y)
The fmod
and fmodf
functions compute the floating-point
remainder of x/y (x modulo y).
The fmod
function returns the value
x-i*y,
for the largest integer i such that, if y is nonzero, the
result has the same sign as x and magnitude less than the
magnitude of y.
fmod(x,0)
returns NaN, and sets errno
to EDOM
.
You can modify error treatment for these functions using matherr
.
fmod
is ANSI C. fmodf
is an extension.
frexp
, frexpf
--split floating-point number#include <math.h> double frexp(double val, int *exp); float frexpf(float val, int *exp);
All non zero, normal numbers can be described as m * 2**p.
frexp
represents the double val as a mantissa m
and a power of two p. The resulting mantissa will always
be greater than or equal to 0.5
, and less than 1.0
(as
long as val is nonzero). The power of two will be stored
in *
exp.
m and p are calculated so that
val is m times 2
to the power p.
frexpf
is identical, other than taking and returning
floats rather than doubles.
frexp
returns the mantissa m. If val is 0
, infinity,
or Nan, frexp
will set *
exp to 0
and return val.
frexp
is ANSI.
frexpf
is an extension.
gamma
, gammaf
, lgamma
, lgammaf
, gamma_r
,#include <math.h> double gamma(double x); float gammaf(float x); double lgamma(double x); float lgammaf(float x); double gamma_r(double x, int *signgamp); float gammaf_r(float x, int *signgamp); double lgamma_r(double x, int *signgamp); float lgammaf_r(float x, int *signgamp);
gamma
calculates
the natural logarithm of the gamma function of x. The gamma function
(exp(gamma(x))
) is a generalization of factorial, and retains
the property that
exp(gamma(N))
is equivalent to N*exp(gamma(N-1))
.
Accordingly, the results of the gamma function itself grow very
quickly. gamma
is defined as
the natural log of the gamma function, rather than the gamma function
itself,
to extend the useful range of results representable.
The sign of the result is returned in the global variable signgam
,
which is declared in math.h.
gammaf
performs the same calculation as gamma
, but uses and
returns float
values.
lgamma
and lgammaf
are alternate names for gamma
and
gammaf
. The use of lgamma
instead of gamma
is a reminder
that these functions compute the log of the gamma function, rather
than the gamma function itself.
The functions gamma_r
, gammaf_r
, lgamma_r
, and
lgammaf_r
are just like gamma
, gammaf
, lgamma
, and
lgammaf
, respectively, but take an additional argument. This
additional argument is a pointer to an integer. This additional
argument is used to return the sign of the result, and the global
variable signgam
is not used. These functions may be used for
reentrant calls (but they will still set the global variable errno
if an error occurs).
Normally, the computed result is returned.
When x is a nonpositive integer, gamma
returns HUGE_VAL
and errno
is set to EDOM
. If the result overflows, gamma
returns HUGE_VAL
and errno
is set to ERANGE
.
You can modify this error treatment using matherr
.
Neither gamma
nor gammaf
is ANSI C.
hypot
, hypotf
--distance from origin#include <math.h> double hypot(double x, double y); float hypotf(float x, float y);
hypot
calculates the Euclidean distance
sqrt(x*x + y*y)
between the origin (0,0) and a point represented by the
Cartesian coordinates (x,y). hypotf
differs only
in the type of its arguments and result.
Normally, the distance value is returned. On overflow,
hypot
returns HUGE_VAL
and sets errno
to
ERANGE
.
You can change the error treatment with matherr
.
hypot
and hypotf
are not ANSI C.
ilogb
, ilogbf
--get exponent of floating point number#include <math.h> int ilogb(double val); int ilogbf(float val);
All non zero, normal numbers can be described as m *
2**p. ilogb
and ilogbf
examine the argument
val, and return p. The functions frexp
and
frexpf
are similar to ilogb
and ilogbf
, but also
return m.
ilogb
and ilogbf
return the power of two used to form the
floating point argument. If val is 0
, they return -
INT_MAX
(INT_MAX
is defined in limits.h). If val is
infinite, or NaN, they return INT_MAX
.
Neither ilogb
nor ilogbf
is required by ANSI C or by
the System V Interface Definition (Issue 2).
infinity
, infinityf
--representation of infinity#include <math.h> double infinity(void); float infinityf(void);
infinity
and infinityf
return the special number IEEE
infinity in double and single precision arithmetic
respectivly.
isnan
,isnanf
,isinf
,isinff
,finite
,finitef
--test for exceptional numbers#include <ieeefp.h> int isnan(double arg); int isinf(double arg); int finite(double arg); int isnanf(float arg); int isinff(float arg); int finitef(float arg);
These functions provide information on the floating point argument supplied.
There are five major number formats -
zero
subnormal
normal
infinity
NAN
isnan
returns 1 if the argument is a nan. isinf
returns 1 if the argument is infinity. finite
returns 1 if the
argument is zero, subnormal or normal.
The isnanf
, isinff
and finitef
perform the same
operations as their isnan
, isinf
and finite
counterparts, but on single precision floating point numbers.
ldexp
, ldexpf
--load exponent#include <math.h> double ldexp(double val, int expon); float ldexpf(float val, int expon);
ldexp
calculates the value
val times 2 to the power expon.
ldexpf
is identical, save that it takes and returns float
rather than double
values.
ldexp
returns the calculated value.
Underflow and overflow both set errno
to ERANGE
.
On underflow, ldexp
and ldexpf
return 0.0.
On overflow, ldexp
returns plus or minus HUGE_VAL
.
ldexp
is ANSI, ldexpf
is an extension.
log
, logf
--natural logarithms#include <math.h> double log(double x); float logf(float x);
Return the natural logarithm of x, that is, its logarithm base e
(where e is the base of the natural system of logarithms, 2.71828...).
log
and logf
are identical save for the return and argument types.
You can use the (non-ANSI) function matherr
to specify error
handling for these functions.
Normally, returns the calculated value. When x is zero, the
returned value is -HUGE_VAL
and errno
is set to ERANGE
.
When x is negative, the returned value is -HUGE_VAL
and
errno
is set to EDOM
. You can control the error behavior via
matherr
.
log
is ANSI, logf
is an extension.
log10
, log10f
--base 10 logarithms#include <math.h> double log10(double x); float log10f(float x);
log10
returns the base 10 logarithm of x.
It is implemented as log(x) / log(10)
.
log10f
is identical, save that it takes and returns float
values.
log10
and log10f
return the calculated value.
See the description of log
for information on errors.
log10
is ANSI C. log10f
is an extension.
log1p
, log1pf
--log of 1 + x
#include <math.h> double log1p(double x); float log1pf(float x);
log1p
calculates
the natural logarithm of 1+x
. You can use log1p
rather
than `log(1+x)
' for greater precision when x is very
small.
log1pf
calculates the same thing, but accepts and returns
float
values rather than double
.
log1p
returns a double
, the natural log of 1+x
.
log1pf
returns a float
, the natural log of 1+x
.
Neither log1p
nor log1pf
is required by ANSI C or by the System V
Interface Definition (Issue 2).
matherr
--modifiable math error handler#include <math.h> int matherr(struct exception *e);
matherr
is called whenever a math library function generates an error.
You can replace matherr
by your own subroutine to customize
error treatment. The customized matherr
must return 0 if
it fails to resolve the error, and non-zero if the error is resolved.
When matherr
returns a nonzero value, no error message is printed
and the value of errno
is not modified. You can accomplish either
or both of these things in your own matherr
using the information
passed in the structure *e
.
This is the exception
structure (defined in `math.h
'):
struct exception { int type; char *name; double arg1, arg2, retval; int err; };
The members of the exception structure have the following meanings:
type
math.h
'.
name
arg1, arg2
retval
err
errno
.
The error types defined in `math.h
' represent possible mathematical
errors as follows:
DOMAIN
log(-1.0)
.
SING
pow(0.0,-2.0)
OVERFLOW
exp(1000.0)
.
UNDERFLOW
exp(-1000.0)
.
TLOSS
sin(10e70)
.
PLOSS
The library definition for matherr
returns 0
in all cases.
You can change the calling function's result from a customized matherr
by modifying e->retval
, which propagates backs to the caller.
If matherr
returns 0
(indicating that it was not able to resolve
the error) the caller sets errno
to an appropriate value, and prints
an error message.
matherr
is not ANSI C.
modf
, modff
--split fractional and integer parts#include <math.h> double modf(double val, double *ipart); float modff(float val, float *ipart);
modf
splits the double val apart into an integer part
and a fractional part, returning the fractional part and
storing the integer part in *ipart
. No rounding
whatsoever is done; the sum of the integer and fractional
parts is guaranteed to be exactly equal to val. That
is, if . realpart = modf(val, &intpart); then
`realpart+intpart
' is the same as val.
modff
is identical, save that it takes and returns
float
rather than double
values.
The fractional part is returned. Each result has the same
sign as the supplied argument val.
modf
is ANSI C. modff
is an extension.
nan
, nanf
--representation of infinity#include <math.h> double nan(void); float nanf(void);
nan
and nanf
return an IEEE NaN (Not a Number) in
double and single precision arithmetic respectivly.
nextafter
, nextafterf
--get next number#include <math.h> double nextafter(double val, double dir); float nextafterf(float val, float dir);
nextafter
returns the double) precision floating point number
closest to val in the direction toward dir. nextafterf
performs the same operation in single precision. For example,
nextafter(0.0,1.0)
returns the smallest positive number which is
representable in double precision.
Returns the next closest number to val in the direction toward
dir.
Neither nextafter
nor nextafterf
is required by ANSI C
or by the System V Interface Definition (Issue 2).
pow
, powf
--x to the power y#include <math.h> double pow(double x, double y); float pow(float x, float y);
pow
and powf
calculate x raised to the exp1.0nt y.
On success, pow
and powf
return the value calculated.
When the argument values would produce overflow, pow
returns HUGE_VAL
and set errno
to ERANGE
. If the
argument x passed to pow
or powf
is a negative
noninteger, and y is also not an integer, then errno
is set to EDOM
. If x and y are both 0, then
pow
and powf
return 1
.
You can modify error handling for these functions using matherr
.
pow
is ANSI C. powf
is an extension.
rint
, rintf
, remainder
, remainderf
--round and remainder#include <math.h> double rint(double x); float rintf(float x); double remainder(double x, double y); float remainderf(float x, float y);
rint
and rintf
returns their argument rounded to the nearest
integer. remainder
and remainderf
find the remainder of
x/y; this value is in the range -y/2 .. +y/2.
rint
and remainder
return the integer result as a double.
rint
and remainder
are System V release 4. rintf
and
remainderf
are extensions.
scalbn
, scalbnf
--scale by integer#include <math.h> double scalbn(double x, int y); float scalbnf(float x, int y);
scalbn
and scalbnf
scale x by n, returning x times
2 to the power n. The result is computed by manipulating the
exponent, rather than by actually performing an exponentiation or
multiplication.
x times 2 to the power n.
Neither scalbn
nor scalbnf
is required by ANSI C or by the System V
Interface Definition (Issue 2).
sqrt
, sqrtf
--positive square root#include <math.h> double sqrt(double x); float sqrtf(float x);
sqrt
computes the positive square root of the argument.
You can modify error handling for this function with
matherr
.
On success, the square root is returned. If x is real and
positive, then the result is positive. If x is real and
negative, the global value errno
is set to EDOM
(domain error).
sqrt
is ANSI C. sqrtf
is an extension.
sin
, sinf
, cos
, cosf
--sine or cosine#include <math.h> double sin(double x); float sinf(float x); double cos(double x); float cosf(float x);
sin
and cos
compute (respectively) the sine and cosine
of the argument x. Angles are specified in radians.
sinf
and cosf
are identical, save that they take and
return float
values.
The sine or cosine of x is returned.
sin
and cos
are ANSI C.
sinf
and cosf
are extensions.
sinh
, sinhf
--hyperbolic sine#include <math.h> double sinh(double x); float sinhf(float x);
sinh
computes the hyperbolic sine of the argument x.
Angles are specified in radians. sinh
(x) is defined as
(exp(x) - exp(-x))/2
sinhf
is identical, save that it takes and returns float
values.
The hyperbolic sine of x is returned.
When the correct result is too large to be representable (an
overflow), sinh
returns HUGE_VAL
with the
appropriate sign, and sets the global value errno
to
ERANGE
.
You can modify error handling for these functions with matherr
.
sinh
is ANSI C.
sinhf
is an extension.
tan
, tanf
--tangent#include <math.h> double tan(double x); float tanf(float x);
tan
computes the tangent of the argument x.
Angles are specified in radians.
tanf
is identical, save that it takes and returns float
values.
The tangent of x is returned.
tan
is ANSI. tanf
is an extension.
tanh
, tanhf
--hyperbolic tangent#include <math.h> double tanh(double x); float tanhf(float x);
tanh
computes the hyperbolic tangent of
the argument x. Angles are specified in radians.
tanh(x)
is defined as
sinh(x)/cosh(x)
tanhf
is identical, save that it takes and returns float
values.
The hyperbolic tangent of x is returned.
tanh
is ANSI C. tanhf
is an extension.
libm
When a libm function detects an exceptional case, errno
may be
set, the matherr
function may be called, and a error message
may be written to the standard error stream. This behavior may not
be reentrant.
With reentrant C libraries like the Cygnus C library, errno
is
a macro which expands to the per-thread error value. This makes it thread
safe.
When the user provides his own matherr
function it must be
reentrant for the math library as a whole to be reentrant.
In normal debugged programs, there are usually no math subroutine
errors--and therefore no assignments to errno
and no matherr
calls; in that situation, the math functions behave reentrantly.
acos
: acos
acosf
: acos
acosh
: acosh
acoshf
: acosh
asin
: asin
asinf
: asin
asinh
: asinh
asinhf
: asinh
atan
: atan
atan2
: atan2
atan2f
: atan2
atanf
: atan
atanh
: atanh
atanhf
: atanh
cbrt
: cbrt
cbrtf
: cbrt
ceil
: floor
ceilf
: floor
copysign
: copysign
copysignf
: copysign
cos
: sin
cosf
: sin
erf
: erf
erfc
: erf
erfcf
: erf
erff
: erf
exp
: exp
expf
: exp
expm1
: expm1
expm1f
: expm1
fabs
: fabs
fabsf
: fabs
finite
: isnan
finitef
: isnan
floor
: floor
floorf
: floor
fmod
: fmod
fmodf
: fmod
frexp
: frexp
frexpf
: frexp
gamma
: gamma
gamma_r
: gamma
gammaf
: gamma
gammaf_r
: gamma
hypot
: hypot
hypotf
: hypot
ilogb
: ilogb
ilogbf
: ilogb
infinity
: infinity
infinityf
: infinity
isinf
: isnan
isinff
: isnan
isnan
: isnan
isnanf
: isnan
j0
: jN
j0f
: jN
j1
: jN
j1f
: jN
jn
: jN
jnf
: jN
ldexp
: ldexp
ldexpf
: ldexp
lgamma
: gamma
lgamma_r
: gamma
lgammaf
: gamma
lgammaf_r
: gamma
log
: log
log10
: log10
log10f
: log10
log1p
: log1p
log1pf
: log1p
logf
: log
matherr
: matherr
matherr
and reentrancy: Reentrancy
modf
: modf
modff
: modf
nan
: nan
nanf
: nan
nextafter
: nextafter
nextafterf
: nextafter
pow
: pow
powf
: pow
remainder
: rint
remainderf
: rint
rint
: rint
rintf
: rint
scalbn
: scalbn
scalbnf
: scalbn
sin
: sin
sinf
: sin
sinh
: sinh
sinhf
: sinh
sqrt
: sqrt
sqrtf
: sqrt
tan
: tan
tanf
: tan
tanh
: tanh
tanhf
: tanh
y0
: jN
y0f
: jN
y1
: jN
y1f
: jN
yn
: jN
ynf
: jN
libm/math.h
)
acos
, acosf
--arc cosine
acosh
, acoshf
--inverse hyperbolic cosine
asin
, asinf
--arc sine
asinh
, asinhf
--inverse hyperbolic sine
atan
, atanf
--arc tangent
atan2
, atan2f
--arc tangent of y/x
atanh
, atanhf
--inverse hyperbolic tangent
jN
,jNf
,yN
,yNf
--Bessel functions
cbrt
, cbrtf
--cube root
copysign
, copysignf
--sign of y, magnitude of x
cosh
, coshf
--hyperbolic cosine
erf
, erff
, erfc
, erfcf
--error function
exp
, expf
--exponential
expm1
, expm1f
--exponential minus 1
fabs
, fabsf
--absolute value (magnitude)
floor
, floorf
, ceil
, ceilf
--floor and ceiling
fmod
, fmodf
--floating-point remainder (modulo)
frexp
, frexpf
--split floating-point number
gamma
, gammaf
, lgamma
, lgammaf
, gamma_r
,
hypot
, hypotf
--distance from origin
ilogb
, ilogbf
--get exponent of floating point number
infinity
, infinityf
--representation of infinity
isnan
,isnanf
,isinf
,isinff
,finite
,finitef
--test for exceptional numbers
ldexp
, ldexpf
--load exponent
log
, logf
--natural logarithms
log10
, log10f
--base 10 logarithms
log1p
, log1pf
--log of 1 + x
matherr
--modifiable math error handler
modf
, modff
--split fractional and integer parts
nan
, nanf
--representation of infinity
nextafter
, nextafterf
--get next number
pow
, powf
--x to the power y
rint
, rintf
, remainder
, remainderf
--round and remainder
scalbn
, scalbnf
--scale by integer
sqrt
, sqrtf
--positive square root
sin
, sinf
, cos
, cosf
--sine or cosine
sinh
, sinhf
--hyperbolic sine
tan
, tanf
--tangent
tanh
, tanhf
--hyperbolic tangent
libm