Skip to content

Commit

Permalink
Always use reference value when computing percentage difference
Browse files Browse the repository at this point in the history
  • Loading branch information
axman6 committed May 6, 2024
1 parent 2ae8516 commit 00ca1f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,4 @@ between (lo,hi) = \x -> lo <= x && x <= hi


withinPCT :: Double -> Double -> Double -> Bool
withinPCT pct a b = abs ((a - b) * 100 / (min `on` abs) a b) < pct
withinPCT pct a b = abs ((a - b) * 100 / abs b) < pct

0 comments on commit 00ca1f8

Please sign in to comment.