use crate::IntAsScalar;
mod to_float_u32_impl;
mod to_float_u64_impl;
pub trait IntoFloat: IntAsScalar {
type F;
fn into_float_with_exponent(self, exponent: i32) -> Self::F;
}
pub trait FloatFromInt: Sized {
type UInt;
fn cast_from_int(i: Self::UInt) -> Self;
}
impl FloatFromInt for f32 {
type UInt = u32;
fn cast_from_int(i: Self::UInt) -> Self {
i as f32
}
}
impl FloatFromInt for f64 {
type UInt = u64;
fn cast_from_int(i: Self::UInt) -> Self {
i as f64
}
}