#float #floating-point #precision

extended

Extended precision 80-bit floating-point numbers (f80)

1 unstable release

0.1.0 May 27, 2022

#1600 in Math

Download history 5832/week @ 2024-07-20 5695/week @ 2024-07-27 8248/week @ 2024-08-03 7240/week @ 2024-08-10 6131/week @ 2024-08-17 7428/week @ 2024-08-24 7030/week @ 2024-08-31 8519/week @ 2024-09-07 9212/week @ 2024-09-14 11583/week @ 2024-09-21 10726/week @ 2024-09-28 13306/week @ 2024-10-05 11670/week @ 2024-10-12 8884/week @ 2024-10-19 14072/week @ 2024-10-26 15201/week @ 2024-11-02

51,502 downloads per month
Used in 31 crates (2 directly)

MIT license

14KB
238 lines

80-bit Extended-Precision Floating-Point Numbers

This is a Rust library that provides a type for representing 80-bit extended-precision floating-point numbers. It is licensed under the terms of the MIT license, see LICENSE.txt for details.

Rounding, Infinity, and NaN

This library uses round-to-even when converting from 80-bit floats to 64-bit floats. This should be what you’re used to, and what you expect! In round-to-even, when an 80-bit float is exactly half-way between two possible float64 values, the value with a zero in the least-significant bit is chosen (or the value with the larger exponent is chosen, if the values have different exponents).

Values which are outside the range of possible float64 values are rounded to infinity.

Infinity and NaN are preserved. Different types of NaN values are not distinguished from each other, but the sign of NaN values is preserved during conversion.


lib.rs:

Extended-precision 80-bit floating-point numbers (f80).

No runtime deps