Skip to content

Commit

Permalink
Allow units with rational exponents
Browse files Browse the repository at this point in the history
closes #561
  • Loading branch information
sharkdp committed Oct 11, 2024
1 parent 5e8e63a commit 4a89ef0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion numbat/src/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 4a89ef0

Please sign in to comment.