Module libc/math

libc/math

C11 <math.h> — mathematical functions and constants.

Functions

sin function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

cos function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

tan function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

asin function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

acos function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

atan function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

atan2 function
fn(y : f64, x : f64) -> f64

Parameters

NameTypeNotes
yf64
xf64

Returns: f64

sinh function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

cosh function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

tanh function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

asinh function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

acosh function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

atanh function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

exp function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

exp2 function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

expm1 function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

log function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

log2 function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

log10 function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

log1p function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

logb function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

ilogb function
fn(x : f64) -> int

Parameters

NameTypeNotes
xf64

Returns: int

pow function
fn(x : f64, y : f64) -> f64

Parameters

NameTypeNotes
xf64
yf64

Returns: f64

sqrt function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

cbrt function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

hypot function
fn(x : f64, y : f64) -> f64

Parameters

NameTypeNotes
xf64
yf64

Returns: f64

erf function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

erfc function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

gamma function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

lgamma function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

ceil function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

floor function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

trunc function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

round function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

lround function
fn(x : f64) -> long

Parameters

NameTypeNotes
xf64

Returns: long

llround function
fn(x : f64) -> longlong

Parameters

NameTypeNotes
xf64

Returns: longlong

rint function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

lrint function
fn(x : f64) -> long

Parameters

NameTypeNotes
xf64

Returns: long

llrint function
fn(x : f64) -> longlong

Parameters

NameTypeNotes
xf64

Returns: longlong

nearbyint function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

frexp function
fn(value : f64, _exp : *(int)) -> f64

Parameters

NameTypeNotes
valuef64
_exp*(int)

Returns: f64

ldexp function
fn(x : f64, _exp : int) -> f64

Parameters

NameTypeNotes
xf64
_expint

Returns: f64

modf function
fn(value : f64, iptr : *(f64)) -> f64

Parameters

NameTypeNotes
valuef64
iptr*(f64)

Returns: f64

scalbn function
fn(x : f64, n : int) -> f64

Parameters

NameTypeNotes
xf64
nint

Returns: f64

scalbln function
fn(x : f64, n : long) -> f64

Parameters

NameTypeNotes
xf64
nlong

Returns: f64

fabs function
fn(x : f64) -> f64

Parameters

NameTypeNotes
xf64

Returns: f64

fmod function
fn(x : f64, y : f64) -> f64

Parameters

NameTypeNotes
xf64
yf64

Returns: f64

remainder function
fn(x : f64, y : f64) -> f64

Parameters

NameTypeNotes
xf64
yf64

Returns: f64

remquo function
fn(x : f64, y : f64, quo : *(int)) -> f64

Parameters

NameTypeNotes
xf64
yf64
quo*(int)

Returns: f64

copysign function
fn(x : f64, y : f64) -> f64

Parameters

NameTypeNotes
xf64
yf64

Returns: f64

nan function
fn(tagp : *(char)) -> f64

Parameters

NameTypeNotes
tagp*(char)

Returns: f64

nanf function
fn(tagp : *(char)) -> f32

Parameters

NameTypeNotes
tagp*(char)

Returns: f32

nanl function
fn(tagp : *(char)) -> longdouble

Parameters

NameTypeNotes
tagp*(char)

Returns: longdouble

fdim function
fn(x : f64, y : f64) -> f64

Parameters

NameTypeNotes
xf64
yf64

Returns: f64

fmax function
fn(x : f64, y : f64) -> f64

Parameters

NameTypeNotes
xf64
yf64

Returns: f64

fmin function
fn(x : f64, y : f64) -> f64

Parameters

NameTypeNotes
xf64
yf64

Returns: f64

fma function
fn(x : f64, y : f64, z : f64) -> f64

Parameters

NameTypeNotes
xf64
yf64
zf64

Returns: f64

fpclassify function
fn(x : f64) -> int

Parameters

NameTypeNotes
xf64

Returns: int

isfinite function
fn(x : f64) -> int

Parameters

NameTypeNotes
xf64

Returns: int

isinf function
fn(x : f64) -> int

Parameters

NameTypeNotes
xf64

Returns: int

isnan function
fn(x : f64) -> int

Parameters

NameTypeNotes
xf64

Returns: int

isnormal function
fn(x : f64) -> int

Parameters

NameTypeNotes
xf64

Returns: int

signbit function
fn(x : f64) -> int

Parameters

NameTypeNotes
xf64

Returns: int

isgreater function
fn(x : f64, y : f64) -> int

Parameters

NameTypeNotes
xf64
yf64

Returns: int

isgreaterequal function
fn(x : f64, y : f64) -> int

Parameters

NameTypeNotes
xf64
yf64

Returns: int

isless function
fn(x : f64, y : f64) -> int

Parameters

NameTypeNotes
xf64
yf64

Returns: int

islessequal function
fn(x : f64, y : f64) -> int

Parameters

NameTypeNotes
xf64
yf64

Returns: int

islessgreater function
fn(x : f64, y : f64) -> int

Parameters

NameTypeNotes
xf64
yf64

Returns: int

isunordered function
fn(x : f64, y : f64) -> int

Parameters

NameTypeNotes
xf64
yf64

Returns: int

sinf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

cosf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

tanf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

asinf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

acosf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

atanf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

atan2f function
fn(y : f32, x : f32) -> f32

Parameters

NameTypeNotes
yf32
xf32

Returns: f32

sinhf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

coshf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

tanhf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

asinhf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

acoshf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

atanhf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

expf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

exp2f function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

expm1f function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

logf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

log2f function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

log10f function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

log1pf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

logbf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

ilogbf function
fn(x : f32) -> int

Parameters

NameTypeNotes
xf32

Returns: int

powf function
fn(x : f32, y : f32) -> f32

Parameters

NameTypeNotes
xf32
yf32

Returns: f32

sqrtf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

cbrtf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

hypotf function
fn(x : f32, y : f32) -> f32

Parameters

NameTypeNotes
xf32
yf32

Returns: f32

erff function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

erfcf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

gammaf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

lgammaf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

ceilf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

floorf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

truncf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

roundf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

lroundf function
fn(x : f32) -> long

Parameters

NameTypeNotes
xf32

Returns: long

llroundf function
fn(x : f32) -> longlong

Parameters

NameTypeNotes
xf32

Returns: longlong

rintf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

lrintf function
fn(x : f32) -> long

Parameters

NameTypeNotes
xf32

Returns: long

llrintf function
fn(x : f32) -> longlong

Parameters

NameTypeNotes
xf32

Returns: longlong

nearbyintf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

frexpf function
fn(value : f32, _exp : *(int)) -> f32

Parameters

NameTypeNotes
valuef32
_exp*(int)

Returns: f32

ldexpf function
fn(x : f32, _exp : int) -> f32

Parameters

NameTypeNotes
xf32
_expint

Returns: f32

modff function
fn(value : f32, iptr : *(f32)) -> f32

Parameters

NameTypeNotes
valuef32
iptr*(f32)

Returns: f32

scalbnf function
fn(x : f32, n : int) -> f32

Parameters

NameTypeNotes
xf32
nint

Returns: f32

scalblnf function
fn(x : f32, n : long) -> f32

Parameters

NameTypeNotes
xf32
nlong

Returns: f32

fabsf function
fn(x : f32) -> f32

Parameters

NameTypeNotes
xf32

Returns: f32

fmodf function
fn(x : f32, y : f32) -> f32

Parameters

NameTypeNotes
xf32
yf32

Returns: f32

remainderf function
fn(x : f32, y : f32) -> f32

Parameters

NameTypeNotes
xf32
yf32

Returns: f32

remquof function
fn(x : f32, y : f32, quo : *(int)) -> f32

Parameters

NameTypeNotes
xf32
yf32
quo*(int)

Returns: f32

copysignf function
fn(x : f32, y : f32) -> f32

Parameters

NameTypeNotes
xf32
yf32

Returns: f32

fdimf function
fn(x : f32, y : f32) -> f32

Parameters

NameTypeNotes
xf32
yf32

Returns: f32

fmaxf function
fn(x : f32, y : f32) -> f32

Parameters

NameTypeNotes
xf32
yf32

Returns: f32

fminf function
fn(x : f32, y : f32) -> f32

Parameters

NameTypeNotes
xf32
yf32

Returns: f32

fmaf function
fn(x : f32, y : f32, z : f32) -> f32

Parameters

NameTypeNotes
xf32
yf32
zf32

Returns: f32

sinl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

cosl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

tanl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

asinl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

acosl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

atanl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

atan2l function
fn(x : longdouble, y : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble
ylongdouble

Returns: longdouble

sinhl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

coshl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

tanhl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

asinhl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

acoshl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

atanhl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

expl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

exp2l function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

expm1l function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

logl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

log2l function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

log10l function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

log1pl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

logbl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

ilogbl function
fn(x : longdouble) -> int

Parameters

NameTypeNotes
xlongdouble

Returns: int

powl function
fn(x : longdouble, y : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble
ylongdouble

Returns: longdouble

sqrtl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

cbrtl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

hypotl function
fn(x : longdouble, y : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble
ylongdouble

Returns: longdouble

erfl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

erfcl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

gammal function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

lgammal function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

ceill function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

floorl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

truncl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

roundl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

lroundl function
fn(x : longdouble) -> long

Parameters

NameTypeNotes
xlongdouble

Returns: long

llroundl function
fn(x : longdouble) -> longlong

Parameters

NameTypeNotes
xlongdouble

Returns: longlong

rintl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

lrintl function
fn(x : longdouble) -> long

Parameters

NameTypeNotes
xlongdouble

Returns: long

llrintl function
fn(x : longdouble) -> longlong

Parameters

NameTypeNotes
xlongdouble

Returns: longlong

nearbyintl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

frexpl function
fn(value : longdouble, _exp : *(int)) -> longdouble

Parameters

NameTypeNotes
valuelongdouble
_exp*(int)

Returns: longdouble

ldexpl function
fn(x : longdouble, _exp : int) -> longdouble

Parameters

NameTypeNotes
xlongdouble
_expint

Returns: longdouble

modfl function
fn(value : longdouble, iptr : *(longdouble)) -> longdouble

Parameters

NameTypeNotes
valuelongdouble
iptr*(longdouble)

Returns: longdouble

scalbnl function
fn(x : longdouble, n : int) -> longdouble

Parameters

NameTypeNotes
xlongdouble
nint

Returns: longdouble

scalblnl function
fn(x : longdouble, n : long) -> longdouble

Parameters

NameTypeNotes
xlongdouble
nlong

Returns: longdouble

fabsl function
fn(x : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble

Returns: longdouble

fmodl function
fn(x : longdouble, y : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble
ylongdouble

Returns: longdouble

remainderl function
fn(x : longdouble, y : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble
ylongdouble

Returns: longdouble

remquol function
fn(x : longdouble, y : longdouble, quo : *(int)) -> longdouble

Parameters

NameTypeNotes
xlongdouble
ylongdouble
quo*(int)

Returns: longdouble

copysignl function
fn(x : longdouble, y : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble
ylongdouble

Returns: longdouble

fdiml function
fn(x : longdouble, y : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble
ylongdouble

Returns: longdouble

fmaxl function
fn(x : longdouble, y : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble
ylongdouble

Returns: longdouble

fminl function
fn(x : longdouble, y : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble
ylongdouble

Returns: longdouble

fmal function
fn(x : longdouble, y : longdouble, z : longdouble) -> longdouble

Parameters

NameTypeNotes
xlongdouble
ylongdouble
zlongdouble

Returns: longdouble

Constants

M_E constant f64

Value: M_E

M_LOG2E constant f64

Value: M_LOG2E

M_LOG10E constant f64

Value: M_LOG10E

M_LN2 constant f64

Value: M_LN2

M_LN10 constant f64

Value: M_LN10

M_PI constant f64

Value: M_PI

M_PI_2 constant f64

Value: M_PI_2

M_PI_4 constant f64

Value: M_PI_4

M_1_PI constant f64

Value: M_1_PI

M_2_PI constant f64

Value: M_2_PI

M_2_SQRTPI constant f64

Value: M_2_SQRTPI

M_SQRT2 constant f64

Value: M_SQRT2

M_SQRT1_2 constant f64

Value: M_SQRT1_2

HUGE_VAL constant f64

Value: HUGE_VAL

HUGE_VALF constant f32

Value: HUGE_VALF

HUGE_VALL constant longdouble

Value: HUGE_VALL

INFINITY constant f32

Value: INFINITY

NAN constant f32

Value: NAN

FP_INFINITE constant int

Value: FP_INFINITE

FP_NAN constant int

Value: FP_NAN

FP_NORMAL constant int

Value: FP_NORMAL

FP_SUBNORMAL constant int

Value: FP_SUBNORMAL

FP_ZERO constant int

Value: FP_ZERO

math_errhandling constant int

Value: math_errhandling

MATH_ERRNO constant int

Value: MATH_ERRNO

MATH_ERREXCEPT constant int

Value: MATH_ERREXCEPT