With the beta release std::num::Float has been deprecated. Does this mean that the trait is gone or was it simply moved?
I ask because I'm using it for my quaternion and vector classes, which is generic over f32 and f64 and make extensive use of the Float trait.
1 Like
The rust devs want to wait a bit before stabilizing number traits (I believe they are waiting for HKT). In the mean-time you can use the num crate on crates.io.
1 Like
A lot of the Float functionality moved directly to the primitives f32 and f64 recently. You can't find them because rustdoc search has an annoying bug making it miss these.
These require specifically annotating the type: 1.0f32.exp()
works but 1.0.exp()
doesn't.
Thanks. The num crate is exactly what I'm looking for. What is HKT?
HKT = higher-kinded types
Actually, they are waiting mainly for associated constants.