From ae8abfa8335edf856f423e7a60c5bb830a79d5a7 Mon Sep 17 00:00:00 2001 From: hachem Date: Sun, 22 Sep 2024 14:24:27 +0200 Subject: Refactor and implement other gates --- libpsi/src/maths/numeric_int.rs | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 libpsi/src/maths/numeric_int.rs (limited to 'libpsi/src/maths/numeric_int.rs') diff --git a/libpsi/src/maths/numeric_int.rs b/libpsi/src/maths/numeric_int.rs new file mode 100644 index 0000000..a9ecec7 --- /dev/null +++ b/libpsi/src/maths/numeric_int.rs @@ -0,0 +1,44 @@ +use super::{Integer, Numeric}; + +impl Integer for i64 {} +impl Integer for i32 {} + +impl Numeric for i32 { + fn zero() -> Self { + 0 + } + + fn one() -> Self { + 1 + } +} + +impl Numeric for i64 { + fn zero() -> Self { + 0 + } + + fn one() -> Self { + 1 + } +} + +impl Numeric for f32 { + fn zero() -> Self { + 0.0 + } + + fn one() -> Self { + 1.0 + } +} + +impl Numeric for f64 { + fn zero() -> Self { + 0.0 + } + + fn one() -> Self { + 1.0 + } +} -- cgit v1.3