umath-0.0.3 has been yanked.
umath: ffast-math, for rust.
Want to make your math faster? *t&c apply
Want to order a float?
You can do all of that, with umath
!
use FFloat;
// wrap a non NAN and non INF f32/f64 (we will also *never* make this number nan).
let mut f = unsafe ;
f *= 3; // multiply by 3
// this check will be removed by the optimizer!
assert!;
# use BinaryHeap;
// use a ORD type! this is allowed, as FFloat is not allowed to be NAN | INF.
let mut b = new;
b.push;
b.push;
b.push;
b.push;
assert_eq!;
A note on safety
When you make your first FFLoat
, you must promise that you will never create a NAN
| INF
FFLoat
. Hence, *f = NAN
is (delayed) UB.
Nightlyness
umath
is nightly because it makes use of core intrinsics, like fadd_fast()
, which require the core_intrinsics
feature to use.