Navigation Menu

Skip to content

Commit

Permalink
Stop to use "==" for comparing floating point number
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 27, 2017
1 parent 71464fd commit 832f19a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/groonga/query-log/response-comparer.rb
Expand Up @@ -74,7 +74,9 @@ def same_select_response?
end

def same_cache_hit_rate?
@response1.body["cache_hit_rate"] == @response2.body["cache_hit_rate"]
cache_hit_rate1 = @response1.body["cache_hit_rate"]
cache_hit_rate2 = @response2.body["cache_hit_rate"]
(cache_hit_rate1 - cache_hit_rate2).abs <= (Float::EPSILON * 10)
end

def care_order?
Expand Down

0 comments on commit 832f19a

Please sign in to comment.