Should the constants in std::f32::consts
(and std::f64::consts
) be made also available as associated constants (cf f32::NAN
)?
f32::PI
is much nicer to type & read than std::f32::consts::PI
. I don't see why mathematical constants need to be relegated to such a long path ):
(There's always the possibility of doing use std::f32::consts as f32c;
in every file but that's kind of annoying...)
I know you wouldn't be able to do use f32::PI;
so perhaps std::f32::consts
shouldn't be deprecated/removed like std::u32
is planned to be, & I don't know how people feel about having the same constants defined in multiple places (maybe that's one reason for not doing this).
Also: for what it's worth the popular crates half
and fixed
already do this for their types.