<cmath> (math.h)

header

<cmath> (math.h)

C numerics library
Header <cmath> declares a set of functions to compute common mathematical operations and transformations:

Functions


Trigonometric functions


Hyperbolic functions


Exponential and logarithmic functions


Power functions


Error and gamma functions


Rounding and remainder functions


Floating-point manipulation functions


Minimum, maximum, difference functions


Other functions


Macros / Functions

These are implemented as macros in C and as functions in C++:

Classification macro / functions


Comparison macro / functions


Macro constants


This header also defines the following macro constants (since C99/C++11):
macrotypedescription
MATH_ERRNO
MATH_ERREXCEPT
intBitmask value with the possible values math_errhandling can take.
FP_FAST_FMA
FP_FAST_FMAF
FP_FAST_FMAL
intEach, if defined, identifies for which type fma is at least as efficient as x*y+z.
FP_INFINITE
FP_NAN
FP_NORMAL
FP_SUBNORMAL
FP_ZERO
intThe possible values returned by fpclassify.
FP_ILOGB0
FP_ILOGBNAN
intSpecial values the ilogb function may return.

Types