[−][src]Crate ieee754
Low-level manipulations of IEEE754 floating-point numbers.
Installation
Add this to your Cargo.toml:
[dependencies]
ieee754 = "0.2"
To enable rayon
parallel iteration, activate the optional
rayon
feature:
[dependencies]
ieee754 = { version = "0.2", features = ["rayon"] }
Examples
use ieee754::Ieee754; // there are 840 single-precision floats between 1.0 and 1.0001 // (inclusive). assert_eq!(1_f32.upto(1.0001).count(), 840);
If rayon
is enabled, this can be performed in parallel:
extern crate ieee754; extern crate rayon; use ieee754::Ieee754; use rayon::prelude::*; // there are 840 single-precision floats between 1.0 and 1.0001 // (inclusive). assert_eq!(1_f32.upto(1.0001).into_par_iter().count(), 840);
Structs
Iter | An iterator over floating point numbers, created by |
Traits
Bits | |
Ieee754 | Types that are IEEE754 floating point numbers. |