Crate math[][src]

Software implementations of operations on IEEE 754 floating point numbers in Rust.

The implementations are not optimised to use any. The code is supposed to be very well documented (as if!) so one could learn from it.

Recommendations

This library is indended to be used with Rust programs on targets where libm is not available or linking to it is undesirable. It does not provide 1-to-1 feature parity with libm. Namely:

Usage

In order to use this library nothing special needs to be done. Use regular functions from the std or core and simply link to this library. In case the target platform has no hardware support for some operation, software implementations provided by this library will be used automagically.

Re-exports

pub use abs::*;
pub use copysign::*;
pub use round::*;
pub use floor::*;
pub use ceil::*;
pub use trunc::*;
pub use lround::*;
pub use llround::*;
pub use dim::*;
pub use ma::*;
pub use fmod::*;
pub use sin::sin;
pub use sin::sinf;
pub use cos::cos;
pub use cos::cosf;
pub use tan::tan;
pub use tan::tanf;
pub use asin::asin;
pub use asin::asinf;
pub use acos::acos;
pub use acos::acosf;
pub use sqrt::*;
pub use exp::*;
pub use logb::*;
pub use ilogb::*;
pub use scalbn::*;
pub use scalbln::*;
pub use modf::*;
pub use nextafter::*;
pub use min::*;
pub use max::*;
pub use hypot::*;
pub use nearbyint::*;
pub use rint::*;
pub use ldexp::*;

Modules

abs
acos
asin
ceil
copysign
cos
dim
exp
floor
fmod
hypot
ilogb
ldexp
llround
logb
lround
ma
max
min
modf
nearbyint
nextafter
rint
round
scalbln
scalbn
sin
sqrt
tan
trunc
utils