Numerics - cppreference.com

Compiler support | Language | Headers | Type support | Program utilities | Variadic function support | Error handling | Dynamic memory management | Strings library | Algorithms | Date and time utilities | Input/output support | Localization support | Concurrency support | Technical Specifications | Symbol index | [edit] | [edit] | Support us | Recent changes | FAQ | Offline version | Special pages | Permanent link | Page information | C | Common mathematical functions | Floating-point environment

From cppreference.com

The C numerics library includes common mathematical functions and types, as well as support for random number generation.

Common mathematical functions

The header

<math.h>

provides

standard C library mathematical functions

such as

fabs

,

sqrt

, and

sin

.

Floating-point environment

The header

<fenv.h>

defines

flags and functions related to exceptional floating-point state

, such as overflow and division by zero.

Pseudo-random number generation

The header

<stdlib.h>

also includes C-style random number generation via

srand

and

rand

.

Complex number arithmetic

The header

<complex.h>

provides types and functions to work with

complex numbers

.

Type-generic math

The header

<tgmath.h>

provides some macros for a function which names XXX:

real function:

float variant XXXf

double variant XXX

longdouble variant XXXl

complex function:

float variant cXXXf

double variant cXXX

longdouble variant cXXXl

Bit manipulation

(since C23)

The header

<stdbit.h>

provides macros and functions to work with the

byte ordering

and

byte and bit representation

of C objects.

Checked integer arithmetic (since C23)

Provides some

type-generic macros

for checked integer arithmetic:

(C23)

checked addition operation on two integers
(type-generic function macro)

[edit]

(C23)

checked subtraction operation on two integers
(type-generic function macro)

[edit]

(C23)

checked multiplication operation on two integers
(type-generic function macro)

[edit]

See also