Everything
7.5.4 Mathematical functions

Mathematical functions are as follows.

Table 7.6

Mathematical Functions

Function/Macro Name

Outline

fpclassify [V1.08 or later]

Classifies a floating-point number as NaN, infinite, normal, subnormal or zero (C99)

isfinite [V1.08 or later]

Determines whether a floating-point number has a finite value (zero, subnormal, or normal) (C99)

isinf [V1.08 or later]

Determines whether a floating-point number is an infinity (C99)

isnan [V1.08 or later]

Determines whether a floating-point number is a NaN (C99)

isnormal [V1.08 or later]

Determines whether a floating-point number is normal (neither zero, subnormal, infinite, nor NaN) (C99)

signbit [V1.08 or later]

Determines whether the sign of a floating-point number is negative (C99)

acos

Arc cosine

acosf

Arc cosine

acosl [V1.08 or later]

Arc cosine (C99)

asin

Arc sine

asinf

Arc sine

asinl [V1.08 or later]

Arc sine (C99)

atan

Arc tangent

atanf

Arc tangent

atanl [V1.08 or later]

Arc tangent (C99)

atan2

Arc tangent (y / x)

atan2f

Arc tangent (y / x)

atan2l [V1.08 or later]

Arc tangent (y / x) (C99)

cos

Cosine

cosf

Cosine

cosl [V1.08 or later]

Cosine (C99)

sin

Sine

sinf

Sine

sinl [V1.08 or later]

Sine (C99)

tan

Tangent

tanf

Tangent

tanl [V1.08 or later]

Tangent (C99)

acosh [V1.08 or later]

Arc hyperbolic cosine (C99)

acoshf [V1.08 or later]

Arc hyperbolic cosine (C99)

acoshl [V1.08 or later]

Arc hyperbolic cosine (C99)

asinh [V1.08 or later]

Arc hyperbolic sine (C99)

asinhf [V1.08 or later]

Arc hyperbolic sine (C99)

asinhl [V1.08 or later]

Arc hyperbolic sine (C99)

atanh [V1.08 or later]

Arc hyperbolic tangent (C99)

atanhf [V1.08 or later]

Arc hyperbolic tangent (C99)

atanhl [V1.08 or later]

Arc hyperbolic tangent (C99)

cosh

Hyperbolic cosine

coshf

Hyperbolic cosine

coshl [V1.08 or later]

Hyperbolic cosine (C99)

sinh

Hyperbolic sine

sinhf

Hyperbolic sine

sinhl [V1.08 or later]

Hyperbolic sine (C99)

tanh

Hyperbolic tangent

tanhf

Hyperbolic tangent

tanhl [V1.08 or later]

Hyperbolic tangent (C99)

exp

Exponent function (natural logarithm)

expf

Exponent function (natural logarithm)

expl [V1.08 or later]

Exponent function (natural logarithm) (C99)

frexp

Break a floating-point number into a normalized fraction and an integral power of 2

frexpf

Break a floating-point number into a normalized fraction and an integral power of 2

frexpl [V1.08 or later]

Break a floating-point number into a normalized fraction and an integral power of 2 (C99)

ldexp

Multiply a floating-point number by an integral power of 2

ldexpf

Multiply a floating-point number by an integral power of 2

ldexpl [V1.08 or later]

Multiply a floating-point number by an integral power of 2 (C99)

log

Logarithmic function (natural logarithm)

logf

Logarithmic function (natural logarithm)

logl [V1.08 or later]

Logarithmic function (natural logarithm) (C99)

log10

Logarithmic function (base = 10)

log10f

Logarithmic function (base = 10)

log10l [V1.08 or later]

Logarithmic function (base = 10) (C99)

log1p [V1.08 or later]

Natural logarithm of 1 plus the argument (C99)

log1pf [V1.08 or later]

Natural logarithm of 1 plus the argument (C99)

log1pl [V1.08 or later]

Natural logarithm of 1 plus the argument (C99)

modf

Break a floating-point number into integral and fractional parts

modff

Break a floating-point number into integral and fractional parts

modfl [V1.08 or later]

Break a floating-point number into integral and fractional parts (C99)

scalbn [V1.09 or later]

Multiply a floating-point number by an integral power of FLT_RADIX (C99)

scalbnf [V1.09 or later]

Multiply a floating-point number by an integral power of FLT_RADIX (C99)

scalbnl [V1.09 or later]

Multiply a floating-point number by an integral power of FLT_RADIX (C99)

scalbln [V1.09 or later]

Multiply a floating-point number by an integral power of FLT_RADIX (C99)

scalblnf [V1.09 or later]

Multiply a floating-point number by an integral power of FLT_RADIX (C99)

scalblnl [V1.09 or later]

Multiply a floating-point number by an integral power of FLT_RADIX (C99)

fabs

Absolute value function

fabsf

Absolute value function

fabsl [V1.08 or later]

Absolute value function (C99)

pow

Power function

powf

Power function

powl [V1.08 or later]

Power function (C99)

sqrt

Square root function

sqrtf

Square root function

sqrtl [V1.08 or later]

Square root function (C99)

ceil

The smallest integer value not less than a floating-point number

ceilf

The smallest integer value not less than a floating-point number

ceill [V1.08 or later]

The smallest integer value not less than a floating-point number (C99)

floor

The largest integer value not greater than a floating-point number

floorf

The largest integer value not greater than a floating-point number

floorl [V1.08 or later]

The largest integer value not greater than a floating-point number (C99)

nearbyint [V1.09 or later]

Rounding to an integer value in floating-point format according to the current rounding direction (C99)

nearbyintf [V1.09 or later]

Rounding to an integer value in floating-point format according to the current rounding direction (C99)

nearbyintl [V1.09 or later]

Rounding to an integer value in floating-point format according to the current rounding direction (C99)

rint [V1.09 or later]

Rounding to an integer value in floating-point format according to the current rounding direction (C99)

rintf [V1.09 or later]

Rounding to an integer value in floating-point format according to the current rounding direction (C99)

rintl [V1.09 or later]

Rounding to an integer value in floating-point format according to the current rounding direction (C99)

lrint [V1.09 or later]

Rounding to a long type integer value according to the current rounding direction (C99)

lrintf [V1.09 or later]

Rounding to a long type integer value according to the current rounding direction (C99)

lrintl [V1.09 or later]

Rounding to a long type integer value according to the current rounding direction (C99)

llrint [V1.09 or later]

Rounding to a long long type integer value according to the current rounding direction (C99)

llrintf [V1.09 or later]

Rounding to a long long type integer value according to the current rounding direction (C99)

llrintl [V1.09 or later]

Rounding to a long long type integer value according to the current rounding direction (C99)

round [V1.09 or later]

Rounding to integer value in floating-point format (C99)

roundf [V1.09 or later]

Rounding to integer value in floating-point format (C99)

roundl [V1.09 or later]

Rounding to integer value in floating-point format (C99)

lround [V1.09 or later]

Rounding to a long type integer value (C99)

lroundf [V1.09 or later]

Rounding to a long type integer value (C99)

lroundl [V1.09 or later]

Rounding to a long type integer value (C99)

llround [V1.09 or later]

Rounding to a long long type integer value (C99)

llroundf [V1.09 or later]

Rounding to a long long type integer value (C99)

llroundl [V1.09 or later]

Rounding to a long long type integer value (C99)

trunc [V1.09 or later]

Rounding to truncated integer value (C99)

truncf [V1.09 or later]

Rounding to truncated integer value (C99)

truncl [V1.09 or later]

Rounding to truncated integer value (C99)

fmod

Remainder function

fmodf

Remainder function

fmodl [V1.08 or later]

Remainder function (C99)

copysign [V1.09 or later]

Generates a value consisting of the given absolute value and sign (C99)

copysignf [V1.09 or later]

Generates a value consisting of the given absolute value and sign (C99)

copysignl [V1.09 or later]

Generates a value consisting of the given absolute value and sign (C99)

nan [V1.09 or later]

Convert character string to NaN (C99)

nanf [V1.09 or later]

Convert character string to NaN (C99)

nanl [V1.09 or later]

Convert character string to NaN (C99)

fdim [V1.09 or later]

Calculation of the positive difference (C99)

fdimf [V1.09 or later]

Calculation of the positive difference (C99)

fdiml [V1.09 or later]

Calculation of the positive difference (C99)

fmax [V1.09 or later]

Obtaing the greater value (C99)

fmaxf [V1.09 or later]

Obtaing the greater value (C99)

fmaxl [V1.09 or later]

Obtaing the greater value (C99)

fmin [V1.09 or later]

Obtaing the smaller value (C99)

fminf [V1.09 or later]

Obtaing the smaller value (C99)

fminl [V1.09 or later]

Obtaing the smaller value (C99)

isgreater [V1.09 or later]

Determining whether the first argument is greater than the second argument (C99)

isgreaterequal [V1.09 or later]

Determining whether the first argument is equal to or greater than the second argument (C99)

isless [V1.09 or later]

Determining whether the first argument is smaller than the second argument (C99)

islessequal [V1.09 or later]

Determining whether the first argument is equal to or smaller than the second argument (C99)

islessgreater [V1.09 or later]

Determining whether the first argument is smaller or greater than the second argument (C99)

isunordered [V1.09 or later]

Determining whether the arguments are not ordered (C99)