<s>
C	B-Language
mathematical	I-Language
operations	I-Language
are	O
a	O
group	O
of	O
functions	O
in	O
the	O
standard	B-Language
library	I-Language
of	O
the	O
C	B-Language
programming	I-Language
language	I-Language
implementing	O
basic	O
mathematical	O
functions	O
.	O
</s>
<s>
All	O
functions	O
use	O
floating-point	B-Algorithm
numbers	I-Algorithm
in	O
one	O
manner	O
or	O
another	O
.	O
</s>
<s>
Different	O
C	B-Language
standards	O
provide	O
different	O
,	O
albeit	O
backwards-compatible	O
,	O
sets	O
of	O
functions	O
.	O
</s>
<s>
Most	O
of	O
these	O
functions	O
are	O
also	O
available	O
in	O
the	O
C++	B-Language
standard	I-Language
library	I-Language
,	O
though	O
in	O
different	O
headers	O
(	O
the	O
C	B-Language
headers	O
are	O
included	O
as	O
well	O
,	O
but	O
only	O
as	O
a	O
deprecated	O
compatibility	O
feature	O
)	O
.	O
</s>
<s>
Most	O
of	O
the	O
mathematical	O
functions	O
are	O
defined	O
in	O
<math.h> ( <cmath>	O
header	O
in	O
C++	B-Language
)	O
.	O
</s>
<s>
The	O
functions	O
that	O
operate	O
on	O
integers	O
,	O
such	O
as	O
abs	O
,	O
labs	O
,	O
div	O
,	O
and	O
ldiv	O
,	O
are	O
instead	O
defined	O
in	O
the	O
<stdlib.h> header ( <cstdlib>	O
header	O
in	O
C++	B-Language
)	O
.	O
</s>
<s>
For	O
those	O
that	O
are	O
,	O
the	O
functions	O
accept	O
only	O
type	O
double	O
for	O
the	O
floating-point	B-Algorithm
arguments	O
,	O
leading	O
to	O
expensive	O
type	O
conversions	O
in	O
code	O
that	O
otherwise	O
used	O
single-precision	O
float	B-Algorithm
values	O
.	O
</s>
<s>
In	O
C99	B-Language
,	O
this	O
shortcoming	O
was	O
fixed	O
by	O
introducing	O
new	O
sets	O
of	O
functions	O
that	O
work	O
on	O
float	B-Algorithm
and	O
long	O
double	O
arguments	O
.	O
</s>
<s>
Function	O
Description	O
abslabsllabs	O
computes	O
absolute	O
value	O
of	O
an	O
integer	O
value	O
fabs	O
computes	O
absolute	O
value	O
of	O
a	O
floating-point	B-Algorithm
value	O
divldivlldiv	O
computes	O
the	O
quotient	O
and	O
remainder	O
of	O
integer	O
division	O
fmod	O
remainder	O
of	O
the	O
floating-point	B-Algorithm
division	O
operation	O
remainder	O
signed	O
remainder	O
of	O
the	O
division	O
operation	O
remquo	O
signed	O
remainder	O
as	O
well	O
as	O
the	O
three	O
last	O
bits	O
of	O
the	O
division	O
operation	O
fma	O
fused	O
multiply-add	O
operation	O
fmax	O
larger	O
of	O
two	O
floating-point	B-Algorithm
values	O
fmin	O
smaller	O
of	O
two	O
floating-point	B-Algorithm
values	O
fdim	O
positive	O
difference	O
of	O
two	O
floating-point	B-Algorithm
values	O
nannanfnanl	O
returns	O
a	O
NaN	O
(	O
not-a-number	O
)	O
Exponentialfunctions	O
exp	O
returns	O
e	O
raised	O
to	O
the	O
given	O
power	O
exp2	O
returns	O
2	O
raised	O
to	O
the	O
given	O
power	O
expm1	O
returns	O
e	O
raised	O
to	O
the	O
given	O
power	O
,	O
minus	O
one	O
log	O
computes	O
natural	O
logarithm	O
(	O
to	O
base	O
e	O
)	O
log2	O
computes	O
binary	O
logarithm	O
(	O
to	O
base	O
2	O
)	O
log10	O
computes	O
common	O
logarithm	O
(	O
to	O
base	O
10	O
)	O
log1p	O
computes	O
natural	O
logarithm	O
(	O
to	O
base	O
e	O
)	O
of	O
1	O
plus	O
the	O
given	O
number	O
ilogb	O
extracts	O
exponent	O
of	O
the	O
number	O
logb	O
extracts	O
exponent	O
of	O
the	O
number	O
Powerfunctions	O
sqrt	O
computes	O
square	O
root	O
cbrt	O
computes	O
cubic	O
root	O
hypot	O
computes	O
square	O
root	O
of	O
the	O
sum	O
of	O
the	O
squares	O
of	O
two	O
given	O
numbers	O
pow	O
raises	O
a	O
number	O
to	O
the	O
given	O
powerNotationally	O
,	O
it	O
may	O
seem	O
convenient	O
to	O
use	O
pow(x,2 )	O
or	O
pow(x,3 )	O
to	O
compute	O
squares	O
or	O
cubes	O
.	O
</s>
<s>
C99	B-Language
adds	O
several	O
functions	O
and	O
types	O
for	O
fine-grained	O
control	O
of	O
floating-point	B-Algorithm
environment	O
.	O
</s>
<s>
These	O
functions	O
can	O
be	O
used	O
to	O
control	O
a	O
variety	O
of	O
settings	O
that	O
affect	O
floating-point	B-Algorithm
computations	O
,	O
for	O
example	O
,	O
the	O
rounding	B-Algorithm
mode	O
,	O
on	O
what	O
conditions	O
exceptions	O
occur	O
,	O
when	O
numbers	O
are	O
flushed	O
to	O
zero	O
,	O
etc	O
.	O
</s>
<s>
The	O
floating-point	B-Algorithm
environment	O
functions	O
and	O
types	O
are	O
defined	O
in	O
<fenv.h> header ( <cfenv>	O
in	O
C++	B-Language
)	O
.	O
</s>
<s>
C99	B-Language
adds	O
a	O
new	O
_Complex	O
keyword	O
(	O
and	O
complex	O
convenience	O
macro	O
)	O
that	O
provides	O
support	O
for	O
complex	O
numbers	O
.	O
</s>
<s>
Any	O
floating-point	B-Algorithm
type	O
can	O
be	O
modified	O
with	O
complex	O
,	O
and	O
is	O
then	O
defined	O
as	O
a	O
pair	O
of	O
floating-point	B-Algorithm
numbers	I-Algorithm
.	O
</s>
<s>
Note	O
that	O
C99	B-Language
and	O
C++	B-Language
do	O
not	O
implement	O
complex	O
numbers	O
in	O
a	O
code-compatible	O
way	O
–	O
the	O
latter	O
instead	O
provides	O
the	O
class	O
.	O
</s>
<s>
As	O
with	O
the	O
real-valued	O
functions	O
,	O
an	O
f	O
or	O
l	O
suffix	O
denotes	O
the	O
float	B-Algorithm
complex	O
or	O
long	O
double	O
complex	O
variant	O
of	O
the	O
function	O
.	O
</s>
<s>
A	O
few	O
more	O
complex	O
functions	O
are	O
"	O
reserved	O
for	O
future	O
use	O
in	O
C99	B-Language
"	O
.	O
</s>
<s>
Implementations	O
are	O
provided	O
by	O
open-source	O
projects	O
that	O
are	O
not	O
part	O
of	O
the	O
standard	B-Language
library	I-Language
.	O
</s>
<s>
This	O
adds	O
a	O
limited	O
support	O
for	O
function	B-Language
overloading	I-Language
of	O
the	O
mathematical	O
functions	O
:	O
the	O
same	O
function	O
name	O
can	O
be	O
used	O
with	O
different	O
types	O
of	O
parameters	O
;	O
the	O
actual	O
function	O
will	O
be	O
selected	O
at	O
compile	O
time	O
according	O
to	O
the	O
types	O
of	O
the	O
parameters	O
.	O
</s>
<s>
Each	O
type-generic	O
macro	O
that	O
corresponds	O
to	O
a	O
function	O
that	O
is	O
defined	O
for	O
both	O
real	O
and	O
complex	O
numbers	O
encapsulates	O
a	O
total	O
of	O
6	O
different	O
functions	O
:	O
float	B-Algorithm
,	O
double	O
and	O
long	O
double	O
,	O
and	O
their	O
complex	O
variants	O
.	O
</s>
<s>
The	O
type-generic	O
macros	O
that	O
correspond	O
to	O
a	O
function	O
that	O
is	O
defined	O
for	O
only	O
real	O
numbers	O
encapsulates	O
a	O
total	O
of	O
3	O
different	O
functions	O
:	O
float	B-Algorithm
,	O
double	O
and	O
long	O
double	O
variants	O
of	O
the	O
function	O
.	O
</s>
<s>
The	O
C++	B-Language
language	I-Language
includes	O
native	O
support	O
for	O
function	B-Language
overloading	I-Language
and	O
thus	O
does	O
not	O
provide	O
the	O
<tgmath.h>	O
header	O
even	O
as	O
a	O
compatibility	O
feature	O
.	O
</s>
<s>
The	O
header	O
<stdlib.h> ( <cstdlib>	O
in	O
C++	B-Language
)	O
defines	O
several	O
functions	O
that	O
can	O
be	O
used	O
for	O
statistically	O
random	O
number	O
generation	O
.	O
</s>
<s>
srand	O
initializes	O
a	O
pseudo-random	B-Algorithm
number	I-Algorithm
generator	I-Algorithm
arc4random	O
generates	O
a	O
pseudo-random	O
number	O
between	O
0	O
and	O
UINT32_MAX	O
,	O
usually	O
using	O
a	O
better	O
algorithm	O
than	O
rand	O
arc4random_uniform	O
generates	O
a	O
pseudo-random	O
number	O
between	O
0	O
and	O
a	O
maximum	O
value	O
.	O
</s>
<s>
arc4random_stir	O
initializes	O
a	O
pseudo-random	B-Algorithm
number	I-Algorithm
generator	I-Algorithm
.	O
</s>
<s>
The	O
arc4random	O
family	O
of	O
random	O
number	O
functions	O
are	O
not	O
defined	O
in	O
POSIX	O
standard	O
,	O
but	O
is	O
found	O
in	O
some	O
common	O
libc	B-Language
implementations	O
.	O
</s>
<s>
It	O
used	O
to	O
refer	O
to	O
the	O
keystream	O
generator	O
of	O
a	O
leaked	O
version	O
of	O
RC4	B-Algorithm
cipher	I-Algorithm
(	O
hence	O
"	O
alleged	O
RC4	B-Algorithm
"	O
)	O
,	O
but	O
different	O
algorithms	O
,	O
usually	O
from	O
other	O
ciphers	O
like	O
ChaCha20	O
,	O
have	O
been	O
implemented	O
since	O
using	O
the	O
same	O
name	O
.	O
</s>
<s>
Some	O
C	B-Language
libraries	I-Language
implement	O
rand	O
using	O
arc4random_uniform	O
internally	O
.	O
</s>
<s>
Under	O
POSIX	O
systems	O
like	O
Linux	B-Application
and	O
BSD	B-Operating_System
,	O
the	O
mathematical	O
functions	O
(	O
as	O
declared	O
in	O
<math.h>	O
)	O
are	O
bundled	O
separately	O
in	O
the	O
mathematical	O
library	O
.	O
</s>
<s>
Arénaire	O
project	O
's	O
(	O
correctly	B-Algorithm
rounded	I-Algorithm
libm	O
)	O
,	O
and	O
its	O
successor	O
and	O
finally	O
.	O
</s>
<s>
SIMD	B-Device
(	O
vectorized	O
)	O
math	O
libraries	O
include	O
,	O
,	O
and	O
Agner	O
Fog	O
's	O
VCL	O
,	O
plus	O
a	O
few	O
closed-source	O
ones	O
like	O
SVML	O
and	O
DirectXMath	O
.	O
</s>
