use core::{
fmt::Debug,
ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign},
};
use approx::{AbsDiffEq, RelativeEq, UlpsEq};
use core_maths::CoreFloat;
use super::macros::define_float_repr_trait;
define_float_repr_trait!(f32, f64);
pub trait Scalar:
Copy
+ Debug
+ PartialEq
+ PartialOrd
+ Add<Output = Self>
+ AddAssign
+ Sub<Output = Self>
+ SubAssign
+ Mul<Output = Self>
+ MulAssign
+ Div<Output = Self>
+ DivAssign
+ Neg
{
const ZERO: Self;
const ONE: Self;
}
pub trait FloatScalar:
Scalar
+ FloatRepr
+ CoreFloat
+ AbsDiffEq<Epsilon = Self>
+ RelativeEq<Epsilon = Self>
+ UlpsEq<Epsilon = Self>
{
const INFINITY: Self;
const NEG_INFINITY: Self;
const NAN: Self;
}