ajtribick / twofloat

A double-double arithmetic library for Rust
BSD 3-Clause "New" or "Revised" License
16 stars 7 forks source link
extended-precision floating-point numerics rust-library

twofloat

Build Status Crate

A double-double arithmetic library for Rust.

This library provides an implementation of double-double arithmetic for the Rust language. Note that this is not the same as the IEEE quadruple-precision floating-point format. Instead, higher precision is obtained by representing the value as the sum of two non-overlapping f64 values.

Operator traits are implemented both for reference and value types where appropriate. The code indicates the source of the algorithms used.

Mathematical constants are available in the twofloat::consts module, which provides the same set of constants as std::f64::consts.

Please note that the implementation of the mathematical functions (exp, powf, etc.) is very preliminary. In particular, they are calculated using operations at the same precision as the result, so they will not return values which are correct to the full precision of the TwoFloat type. This may be addressed in future releases.

Optional features

Known issues

References