add trunc implementation
[vector-math.git] / src / scalar.rs
index 4e5009598aff43900ae158d35d4918c8e0d87140..c1a1ec94c2b59608d8bd40476670185aa5734434 100644 (file)
@@ -352,11 +352,17 @@ macro_rules! impl_float {
                 #[cfg(not(feature = "std"))]
                 return crate::algorithms::base::abs(Scalar, self);
             }
+            fn copy_sign(self, sign: Self) -> Self {
+                #[cfg(feature = "std")]
+                return Value(self.0.copysign(sign.0));
+                #[cfg(not(feature = "std"))]
+                return crate::algorithms::base::copy_sign(Scalar, self, sign);
+            }
             fn trunc(self) -> Self {
                 #[cfg(feature = "std")]
                 return Value(self.0.trunc());
                 #[cfg(not(feature = "std"))]
-                todo!();
+                return crate::algorithms::base::trunc(Scalar, self);
             }
             fn ceil(self) -> Self {
                 #[cfg(feature = "std")]