From 7dce87a1a2fc0c9c334403ab16cb9fcd297355b0 Mon Sep 17 00:00:00 2001 From: wucke13 Date: Wed, 5 Oct 2022 12:04:24 +0200 Subject: [PATCH] [WIP] try to avoid recursion --- src/si/angle.rs | 2 +- src/si/ratio.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/si/angle.rs b/src/si/angle.rs index 46c7abde..37cbea86 100644 --- a/src/si/angle.rs +++ b/src/si/angle.rs @@ -133,7 +133,7 @@ where #[must_use = "method returns a new number and does not mutate the original value"] #[inline(always)] pub fn atan2(self, other: Self) -> Angle { - Angle::new::(self.value.atan2(other.value)) + Angle::new::(::atan2(self.value, other.value)) } } diff --git a/src/si/ratio.rs b/src/si/ratio.rs index f2d05897..576b3c76 100644 --- a/src/si/ratio.rs +++ b/src/si/ratio.rs @@ -1,7 +1,7 @@ //! Ratio (dimensionless quantity). #[cfg(any(feature = "std", feature = "libm"))] -use super::angle::{Angle, radian}; +use super::angle::{radian, Angle}; quantity! { /// Ratio (dimensionless quantity). @@ -45,14 +45,14 @@ where #[must_use = "method returns a new number and does not mutate the original value"] #[inline(always)] pub fn acos(self) -> Angle { - Angle::new::(self.value.acos()) + Angle::new::(::acos(self.value)) } /// Computes the value of the inverse hyperbolic cosine of the ratio. #[must_use = "method returns a new number and does not mutate the original value"] #[inline(always)] pub fn acosh(self) -> Angle { - Angle::new::(self.value.acosh()) + Angle::new::(::acosh(self.value)) } /// Computes the value of the inverse sine of the ratio. @@ -66,28 +66,28 @@ where #[must_use = "method returns a new number and does not mutate the original value"] #[inline(always)] pub fn asinh(self) -> Angle { - Angle::new::(self.value.asinh()) + Angle::new::(::asinh(self.value)) } /// Computes the value of the inverse tangent of the ratio. #[must_use = "method returns a new number and does not mutate the original value"] #[inline(always)] pub fn atan(self) -> Angle { - Angle::new::(self.value.atan()) + Angle::new::(::atan(self.value)) } /// Computes the value of the inverse hyperbolic tangent of the ratio. #[must_use = "method returns a new number and does not mutate the original value"] #[inline(always)] pub fn atanh(self) -> Angle { - Angle::new::(self.value.atanh()) + Angle::new::(::atanh(self.value)) } /// Returns `e^(self)`, (the exponential function). #[must_use = "method returns a new number and does not mutate the original value"] #[inline(always)] pub fn exp(self) -> Ratio { - Ratio::new::(self.value.exp()) + Ratio::new::(::exp(self.value)) } /// Returns 2^(self). @@ -112,7 +112,7 @@ where #[must_use = "method returns a new number and does not mutate the original value"] #[inline(always)] pub fn log(self, base: V) -> Ratio { - Ratio::new::(self.value.log(base)) + Ratio::new::(::log(self.value, base)) } /// Returns the base 2 logarithm of the number.