Skip to content

Commit

Permalink
Use f{32|64}::powi instead of Typenum::Pow::powi.
Browse files Browse the repository at this point in the history
In Rust 1.45 the upgrade to LLVM 10.0 changes the behavior of
`f{32|64}::powi` on Windows. This commit changes the `Quantity::powi`
implementation to simplify down to `f{32|64}::powi` instead of using
`Typenum::Pow::powi` which uses a less precise algorithm. Resolves #192.
  • Loading branch information
iliekturtles committed Jun 22, 2020
1 parent 0bc0b92 commit b27b21a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,18 +810,18 @@ macro_rules! system {
/// * `E`: `typenum::Integer` power.
#[inline(always)]
pub fn powi<E>(
self, e: E
self, _e: E
) -> Quantity<$quantities<$($crate::typenum::Prod<D::$symbol, E>),+>, U, V>
where
$(D::$symbol: $crate::lib::ops::Mul<E>,)+
D::Kind: $crate::marker::Mul,
E: $crate::typenum::Integer,
V: $crate::typenum::Pow<E, Output = V> + $crate::Conversion<V>,
V: $crate::num::Float,
{
Quantity {
dimension: $crate::lib::marker::PhantomData,
units: $crate::lib::marker::PhantomData,
value: $crate::typenum::Pow::powi(self.value, e),
value: self.value.powi(E::to_i32()),
}
}

Expand Down

0 comments on commit b27b21a

Please sign in to comment.