use core::ops::{Add, Div, Mul, Neg, Sub};
use crate::{
algebra::{ApproxEqAbs, ApproxEqRel},
numeric::{
Abs, BoundedMax, BoundedMin, Cbrt, CheckedAdd, CheckedDiv, CheckedMul, CheckedNeg,
CheckedRem, CheckedSub, Clamp, Exponential, Half, Hyperbolic, Hypot, Infinite, IsFinite,
IsInfinite, IsNan, MinMax, MulAdd, Nan, NegOne, One, Power, Rounding, SaturatingAdd,
SaturatingDiv, SaturatingMul, SaturatingNeg, SaturatingSub, SignedEquivalent, Sqrt,
Trigonometry, Two, UnsignedEquivalent, WrappingAdd, WrappingDiv, WrappingMul, WrappingNeg,
WrappingRem, WrappingSub, Zero,
},
};
pub trait Scalar {}
pub trait Signed: Scalar {}
pub trait Unsigned: Scalar {}
pub trait Float: Signed {}
pub trait Int: Scalar + SignedEquivalent + UnsignedEquivalent {}
pub trait SignedInt: Signed + Int {}
pub trait UnsignedInt: Unsigned + Int {}
pub trait HasScalar {
type Scalar: Scalar;
}
pub trait ScalarOps:
Scalar
+ Copy
+ core::fmt::Debug
+ PartialEq
+ PartialOrd
+ MinMax
+ Clamp
+ BoundedMin
+ BoundedMax
+ Zero
+ One
+ Two
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Div<Output = Self>
{
}
pub trait SignedOps: ScalarOps + Signed + Abs + Neg<Output = Self> + NegOne {}
pub trait IntOps: Int + ScalarOps {}
pub trait SignedIntOps: SignedInt + IntOps + SignedOps {}
pub trait CheckedIntOps:
IntOps + CheckedAdd + CheckedSub + CheckedMul + CheckedDiv + CheckedRem
{
}
pub trait SaturatingIntOps:
IntOps + SaturatingAdd + SaturatingSub + SaturatingMul + SaturatingDiv
{
}
pub trait WrappingIntOps:
IntOps + WrappingAdd + WrappingSub + WrappingMul + WrappingDiv + WrappingRem
{
}
pub trait CheckedIntNegOps: CheckedNeg {}
pub trait SaturatingIntNegOps: SaturatingNeg {}
pub trait WrappingIntNegOps: WrappingNeg {}
pub trait FloatOps:
Float
+ SignedOps
+ Rounding
+ IsFinite
+ Infinite
+ IsInfinite
+ Nan
+ IsNan
+ MulAdd
+ Sqrt
+ Trigonometry
+ Exponential
+ Power
+ Cbrt
+ Hyperbolic
+ Hypot
+ ApproxEqAbs<Tolerance = Self>
+ ApproxEqRel<Tolerance = Self>
+ Half
{
}