瀏覽代碼

Merge pull request #614 from sharkdp/fix-561

Allow units with rational exponents
David Peter 1 年之前
父節點
當前提交
66cbea548b
共有 1 個文件被更改,包括 1 次插入1 次删除
  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);