nalgebra/nalgebra-glm/src/traits.rs

37 lines
683 B
Rust
Raw Normal View History

use approx::AbsDiffEq;
2018-10-22 04:11:27 +08:00
use num::{Bounded, FromPrimitive, Signed};
2021-04-11 17:00:38 +08:00
use na::Scalar;
use simba::scalar::{ClosedAdd, ClosedMul, ClosedSub};
use std::cmp::PartialOrd;
/// A number that can either be an integer or a float.
2018-10-22 04:11:27 +08:00
pub trait Number:
Scalar
+ Copy
+ PartialOrd
+ ClosedAdd
+ ClosedSub
+ ClosedMul
+ AbsDiffEq<Epsilon = Self>
+ Signed
+ FromPrimitive
+ Bounded
2018-10-22 04:11:27 +08:00
{
}
2020-03-21 19:16:46 +08:00
impl<
T: Scalar
+ Copy
+ PartialOrd
+ ClosedAdd
+ ClosedSub
+ ClosedMul
2020-03-21 19:16:46 +08:00
+ AbsDiffEq<Epsilon = Self>
+ Signed
+ FromPrimitive
+ Bounded,
> Number for T
{
}