pub trait Scalar: Copy {
fn float(self) -> f32;
}
impl Scalar for u8 {
fn float(self) -> f32 {
self as f32
}
}
impl Scalar for u16 {
fn float(self) -> f32 {
self as f32
}
}
impl Scalar for u32 {
fn float(self) -> f32 {
self as f32
}
}
impl Scalar for u64 {
fn float(self) -> f32 {
self as f32
}
}
impl Scalar for usize {
fn float(self) -> f32 {
self as f32
}
}
impl Scalar for i8 {
fn float(self) -> f32 {
self as f32
}
}
impl Scalar for i16 {
fn float(self) -> f32 {
self as f32
}
}
impl Scalar for i32 {
fn float(self) -> f32 {
self as f32
}
}
impl Scalar for i64 {
fn float(self) -> f32 {
self as f32
}
}
impl Scalar for isize {
fn float(self) -> f32 {
self as f32
}
}
impl Scalar for f32 {
fn float(self) -> f32 {
self
}
}
impl Scalar for f64 {
fn float(self) -> f32 {
self as f32
}
}