Skip to content

Commit

Permalink
Return nil instead of 0 for relative error in SD (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtbg authored Oct 20, 2022
1 parent c898557 commit ea645f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/benchmark/ips/stats/sd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def central_tendency
# @returns [Array<Float, nil>] the slowdown and the error (not calculated for standard deviation)
def slowdown(baseline)
if baseline.central_tendency > central_tendency
[baseline.central_tendency.to_f / central_tendency, 0]
[baseline.central_tendency.to_f / central_tendency, nil]
else
[central_tendency.to_f / baseline.central_tendency, 0]
[central_tendency.to_f / baseline.central_tendency, nil]
end
end

Expand Down

0 comments on commit ea645f6

Please sign in to comment.