Crate libm[][src]

libm in pure Rust

Usage

You can use this crate in two ways:

  • By directly using its free functions, e.g. libm::powf.

  • By importing the F32Ext and / or F64Ext extension traits to add methods like powf to the f32 and f64 types. Then you'll be able to invoke math functions as methods, e.g. x.sqrt().

Traits

F32Ext

Math support for f32

F64Ext

Math support for f64

Functions

acos
acosf
asin
asinf
atan
atan2
atan2f
atanf
cbrt
cbrtf
ceil
ceilf
cos
cosf
cosh
coshf
exp
exp2
exp2f
expf
expm1
expm1f
fabs
fabsf
fdim
fdimf
floor
floorf
fma
fmaf
fmod
fmodf
hypot
hypotf
log
log2
log10
log10f
log1p
log1pf
log2f
logf
pow
powf
round
roundf
scalbn
scalbnf
sin
sinf
sinh
sinhf
sqrt
sqrtf
tan
tanf
tanh
tanhf
trunc
truncf