Skip to content

Commit

Permalink
[WIP] try to avoid recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
wucke13 committed Oct 5, 2022
1 parent 92834dc commit 7dce87a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/si/angle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<U, V> {
Angle::new::<radian>(self.value.atan2(other.value))
Angle::new::<radian>(<V as crate::num::Float>::atan2(self.value, other.value))
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/si/ratio.rs
Original file line number Diff line number Diff line change
@@ -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).
Expand Down Expand Up @@ -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<U, V> {
Angle::new::<radian>(self.value.acos())
Angle::new::<radian>(<V as crate::num::Float>::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<U, V> {
Angle::new::<radian>(self.value.acosh())
Angle::new::<radian>(<V as crate::num::Float>::acosh(self.value))
}

/// Computes the value of the inverse sine of the ratio.
Expand All @@ -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<U, V> {
Angle::new::<radian>(self.value.asinh())
Angle::new::<radian>(<V as crate::num::Float>::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<U, V> {
Angle::new::<radian>(self.value.atan())
Angle::new::<radian>(<V as crate::num::Float>::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<U, V> {
Angle::new::<radian>(self.value.atanh())
Angle::new::<radian>(<V as crate::num::Float>::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<U, V> {
Ratio::new::<ratio>(self.value.exp())
Ratio::new::<ratio>(<V as crate::num::Float>::exp(self.value))
}

/// Returns 2^(self).
Expand All @@ -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<U, V> {
Ratio::new::<ratio>(self.value.log(base))
Ratio::new::<ratio>(<V as crate::num::Float>::log(self.value, base))
}

/// Returns the base 2 logarithm of the number.
Expand Down

0 comments on commit 7dce87a

Please sign in to comment.