From c07ab7911bd50d0060841690a863333a9a3f226d Mon Sep 17 00:00:00 2001 From: hachem Date: Tue, 24 Sep 2024 21:33:51 +0200 Subject: rename project --- libpsi-core/src/maths/numeric_traits.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 libpsi-core/src/maths/numeric_traits.rs (limited to 'libpsi-core/src/maths/numeric_traits.rs') diff --git a/libpsi-core/src/maths/numeric_traits.rs b/libpsi-core/src/maths/numeric_traits.rs new file mode 100644 index 0000000..dd7fdec --- /dev/null +++ b/libpsi-core/src/maths/numeric_traits.rs @@ -0,0 +1,24 @@ +use core::ops; + +pub trait Numeric: + Copy + + PartialOrd + + ops::Add + + ops::Mul + + ops::Sub + + ops::Div + + ops::Neg + + ops::AddAssign + + ops::SubAssign + + ops::MulAssign + + ops::DivAssign +{ + fn zero() -> Self; + fn one() -> Self; +} + +pub trait Integer: Numeric {} +pub trait Float: Numeric { + fn sqrt(self) -> Self; + fn atan2(y: Self, x: Self) -> Self; +} -- cgit v1.3