From b27b21afc3fddf004919632e023cf7d9efafb099 Mon Sep 17 00:00:00 2001 From: Mike Boutin Date: Wed, 17 Jun 2020 20:47:58 -0400 Subject: [PATCH] Use `f{32|64}::powi` instead of `Typenum::Pow::powi`. 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. --- src/system.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/system.rs b/src/system.rs index 1cb465f9..6eea82c4 100644 --- a/src/system.rs +++ b/src/system.rs @@ -810,18 +810,18 @@ macro_rules! system { /// * `E`: `typenum::Integer` power. #[inline(always)] pub fn powi( - self, e: E + self, _e: E ) -> Quantity<$quantities<$($crate::typenum::Prod),+>, U, V> where $(D::$symbol: $crate::lib::ops::Mul,)+ D::Kind: $crate::marker::Mul, E: $crate::typenum::Integer, - V: $crate::typenum::Pow + $crate::Conversion, + 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()), } }