Namespaces
Variants
Actions

Common mathematical functions

From cppreference.com
< c‎ | numeric
 
 
 
Common mathematical functions
Functions
Basic operations
(C99)
(C99)
(C99)
(C99)(C99)(C99)(C23)
Maximum/minimum operations
(C99)
(C99)
Exponential functions
(C23)
(C99)
(C99)
(C23)
(C23)

(C99)
(C99)(C23)
(C23)
(C23)
Power functions
(C99)
(C23)
(C23)

(C99)
(C23)
(C23)
Trigonometric and hyperbolic functions
(C23)
(C23)
(C23)
(C23)
(C99)
(C99)
(C99)
Nearest integer floating-point
(C99)(C99)(C99)
(C99)

(C99)(C99)(C99)
(C23)(C23)(C23)(C23)
Floating-point manipulation
(C99)(C99)
(C99)(C23)
(C99)
Narrowing operations
(C23)
(C23)
(C23)
(C23)
(C23)
(C23)
Quantum and quantum exponent
Decimal re-encoding functions
Total order and payload functions
Classification
(C99)
(C99)
(C99)
(C23)
Error and gamma functions
(C99)
(C99)
(C99)
(C99)
Types
Macro constants
Special floating-point values
(C99)(C23)
Arguments and return values
Error handling
Fast operation indicators
 

Contents

[edit] Types

Defined in header <stdlib.h>
structure type, return of the div function
(typedef) [edit]
structure type, return of the ldiv function
(typedef) [edit]
structure type, return of the lldiv function
(typedef) [edit]
Defined in header <inttypes.h>
structure type, return of the imaxdiv function
(typedef) [edit]
Defined in header <math.h>
most efficient floating-point type at least as wide as float
(typedef) [edit]
most efficient floating-point type at least as wide as double
(typedef) [edit]

[edit] Constants

Defined in header <math.h>
indicates value too big to be representable (infinity) by float, double and long double respectively
(macro constant) [edit]
evaluates to positive infinity or the value guaranteed to overflow a float
(macro constant) [edit]
(C99)
evaluates to a quiet NaN of type float
(macro constant) [edit]
indicates that the fma function generally executes about as fast as, or faster than, a multiply and an add of double operands
(macro constant) [edit]
evaluates to ilogb(x) if x is zero or NaN, respectively
(macro constant) [edit]
defines the error handling mechanism used by the common mathematical functions
(macro constant) [edit]
Classification
indicates a floating-point category
(macro constant) [edit]

[edit] Functions

Defined in header <stdlib.h>
computes absolute value of an integral value (|x|)
(function) [edit]
computes quotient and remainder of integer division
(function) [edit]
Defined in header <inttypes.h>
computes absolute value of an integral value (|x|)
(function) [edit]
computes quotient and remainder of integer division
(function) [edit]
Defined in header <math.h>
Basic operations
(C99)(C99)
computes absolute value of a floating-point value (|x|)
(function) [edit]
(C99)(C99)
computes remainder of the floating-point division operation
(function) [edit]
computes signed remainder of the floating-point division operation
(function) [edit]
(C99)(C99)(C99)
computes signed remainder as well as the three last bits of the division operation
(function) [edit]
(C99)(C99)(C99)
computes fused multiply-add operation
(function) [edit]
(C99)(C99)(C99)
determines larger of two floating-point values
(function) [edit]
(C99)(C99)(C99)
determines smaller of two floating-point values
(function) [edit]
(C99)(C99)(C99)
determines positive difference of two floating-point values (max(0, x-y))
(function) [edit]
(C99)(C99)(C99)
returns a NaN (not-a-number)
(function) [edit]
Exponential functions
(C99)(C99)
computes e raised to the given power (ex)
(function) [edit]
(C99)(C99)(C99)
computes 2 raised to the given power (2x)
(function) [edit]
(C99)(C99)(C99)
computes e raised to the given power, minus one (ex-1)
(function) [edit]
(C99)(C99)
computes natural (base-e) logarithm (ln(x))
(function) [edit]
computes common (base-10) logarithm (log10(x))
(function) [edit]
(C99)(C99)(C99)
computes base-2 logarithm (log2(x))
(function) [edit]
(C99)(C99)(C99)
computes natural (base-e) logarithm of 1 plus the given number (ln(1+x))
(function) [edit]
Power functions
(C99)(C99)
computes a number raised to the given power (xy)
(function) [edit]
(C99)(C99)
computes square root (x)
(function) [edit]
(C99)(C99)(C99)
computes cube root (3x)
(function) [edit]
(C99)(C99)(C99)
computes square root of the sum of the squares of two given numbers (x2
+y2
)
(function) [edit]
Trigonometric functions
(C99)(C99)
computes sine (sin(x))
(function) [edit]
(C99)(C99)
computes cosine (cos(x))
(function) [edit]
(C99)(C99)
computes tangent (tan(x))
(function) [edit]
(C99)(C99)
computes arc sine (arcsin(x))
(function) [edit]
(C99)(C99)
computes arc cosine (arccos(x))
(function) [edit]
(C99)(C99)
computes arc tangent (arctan(x))
(function) [edit]
computes arc tangent, using signs to determine quadrants
(function) [edit]
Hyperbolic functions
(C99)(C99)
computes hyperbolic sine (sinh(x))
(function) [edit]
(C99)(C99)
computes hyperbolic cosine (cosh(x))
(function) [edit]
(C99)(C99)
computes hyperbolic tangent (tanh(x))
(function) [edit]
(C99)(C99)(C99)
computes inverse hyperbolic sine (arsinh(x))
(function) [edit]
(C99)(C99)(C99)
computes inverse hyperbolic cosine (arcosh(x))
(function) [edit]
(C99)(C99)(C99)
computes inverse hyperbolic tangent (artanh(x))
(function) [edit]
Error and gamma functions
(C99)(C99)(C99)
computes error function
(function) [edit]
(C99)(C99)(C99)
computes complementary error function
(function) [edit]
(C99)(C99)(C99)
computes gamma function
(function) [edit]