Ver Fonte

Merge pull request #614 from sharkdp/fix-561

Allow units with rational exponents
David Peter há 1 ano atrás
pai
commit
66cbea548b
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      numbat/src/unit.rs

+ 1 - 1
numbat/src/unit.rs

@@ -131,7 +131,7 @@ impl UnitIdentifier {
 
                     // Multiply by the product of all divisors to make all exponents
                     // integers. This is needed for the next step.
-                    let factor: i128 = key.iter().map(|p| p.1.numer()).product();
+                    let factor: i128 = key.iter().map(|p| p.1.denom()).product();
 
                     key.iter_mut().for_each(|p| p.1 *= factor);