The <math.h> Header File
ANSI-compatible routines for floating point arithmetic
Functions
- abs
- Absolute value of a number.
- acos
- Floating point arc cosine.
- acosh
- Floating point hyperbolic area cosine.
- asin
- Floating point arc sine.
- asinh
- Floating point hyperbolic area sine.
- atan2
- Four-quadrant arc tangent of y/x (or argument of the complex number).
- atan
- Floating point arc tangent.
- atanh
- Floating point hyperbolic area tangent.
- atof
- Converts a string to a floating point.
- cacos
- Complex arc cosine.
- cacosh
- Complex hyperbolic area cosine.
- casin
- Complex arc sine.
- casinh
- Complex hyperbolic area sine.
- catan
- Complex arc tangent.
- catanh
- Complex hyperbolic area tangent.
- ccos
- Complex cosine.
- ccosh
- Complex hyperbolic cosine.
- ceil
- Rounds up the floating point number.
- cexp
- Complex exponential function.
- cln
- Complex natural logarithm (base e).
- clog10
- Complex logarithm, base 10.
- cos
- Floating point cosine.
- cosh
- Floating point hyperbolic cosine.
- csin
- Complex sine.
- csinh
- Complex hyperbolic sine.
- csqrt
- Complex square root.
- ctan
- Complex tangent.
- ctanh
- Complex hyperbolic tangent.
- exp
- Floating point exponential function.
- fabs
- Absolute value of a floating point number.
- floor
- Rounds down the floating point number.
- fmod
- Calculates x modulo y, i.e. the remainder of x/y.
- frexp10
- Splits floating point number into mantissa and exponent.
- hypot
- Calculates hypotenuse of right triangle.
- is_inf
- Checks whether the argument is an infinite number.
- is_nan
- Checks whether the argument is Not_a_Number.
- is_nzero
- Checks whether the argument is negative zero.
- is_pzero
- Checks whether the argument is positive zero.
- is_sinf
- Checks whether the argument is signed infinity.
- is_transfinite
- Checks whether the argument is a transfinite number.
- is_uinf_or_nan
- Checks whether the argument is unsigned infinity or Not_a_Number.
- is_uzero
- Checks whether the argument is unsigned zero.
- labs
- Absolute value of a long integer number.
- ldexp10
- Calculates x times 10 raised to exponent.
- log
- Floating point natural logarithm (base e).
- log10
- Floating point logarithm, base 10.
- modf
- Splits floating point value into integer and fraction part.
- pow
- Floating point power function.
- sin
- Floating point sine.
- sinh
- Floating point hyperbolic sine.
- sqrt
- Floating point square root.
- tan
- Floating point tangent.
- tanh
- Floating point hyperbolic tangent.
Constants
- HALF_PI
- A constant with value PI/2.
- NAN
- A constant defining an undefined value.
- NEGATIVE_INF
- Represents an infinitely large negative quantity.
- NEGATIVE_ZERO
- Represents an infinitely small quantity which is known to be always non-positive.
- PI
- An approximated value of pi.
- POSITIVE_INF
- Represents an infinitely large positive quantity.
- POSITIVE_ZERO
- Represents an infinitely small quantity which is known to be always non-negative.
- UNSIGNED_INF
- Represents an infinite quantity.
- UNSIGNED_ZERO
- Represents an infinitely small quantity with indeterminate sign.
- ZERO
- A deprecated constant.
Predefined Types
- bcd
- Represents the internal organization of floating point numbers
in the format recognized by the TIOS.
- Bool
- An enumeration to describe true or false values.
Note: All functions which return a result of type float are
implemented as macros, although many of them exist as TIOS entries. This is done
because the GCC convention for returning floating point values as function results
differs from the convention expected by the TIOS. This note is mainly unimportant from
the user's point of view. Also note that the timath.h header file
contains all functions from math.h, but in addition to this, it also contains some
TIOS-specific low-level floating point functions.