Skip to content

Commit

Permalink
Merge pull request #614 from sharkdp/fix-561
Browse files Browse the repository at this point in the history
Allow units with rational exponents
  • Loading branch information
sharkdp authored Oct 11, 2024
2 parents 5e8e63a + 4a89ef0 commit 66cbea5
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 66cbea5

Please sign in to comment.