From cd58e20fc26c1e6418be5a22738a7a983f9c2943 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 21 Aug 2024 18:24:45 -0700 Subject: [PATCH] integer: give Planar64 abs --- src/integer.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/integer.rs b/src/integer.rs index 824fe8a..377a097 100644 --- a/src/integer.rs +++ b/src/integer.rs @@ -448,6 +448,10 @@ impl Planar64{ self.0 } #[inline] + pub const fn abs(self)->Self{ + Self(self.0.abs()) + } + #[inline] pub fn sqrt(&self)->Self{ Planar64(unsafe{(((self.0 as i128)<<32) as f64).sqrt().to_int_unchecked()}) }