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

This library depends on the std implementations of the floating point mathematical functions, which in turn depend on the C standard library implementation, which may have variations between platforms. In particular, the MinGW platforms i686-pc-windows-gnu and x86_64-pc-windows-gnu do not pass the test suite, so these platforms are currently unsupported. In future it may be possible to use libm to address this issue.

References