couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [1/6] bear commit: updated refs/heads/upstream to 1c7f37c
Date Wed, 28 Oct 2015 20:55:28 GMT
Repository: couchdb-bear
Updated Branches:
  refs/heads/upstream [created] 1c7f37c6f


Fix harmonic_mean behaviour when all values are 0 OR 0.0


Project: http://git-wip-us.apache.org/repos/asf/couchdb-bear/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-bear/commit/88ff370b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-bear/tree/88ff370b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-bear/diff/88ff370b

Branch: refs/heads/upstream
Commit: 88ff370b8d859d390b20f62d797bfc03369851fd
Parents: 5f99806
Author: Seb Maynard <seb@seb.so>
Authored: Thu Aug 28 10:49:32 2014 +0100
Committer: Seb Maynard <seb@seb.so>
Committed: Thu Aug 28 10:49:32 2014 +0100

----------------------------------------------------------------------
 src/bear.erl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-bear/blob/88ff370b/src/bear.erl
----------------------------------------------------------------------
diff --git a/src/bear.erl b/src/bear.erl
index 3a7898f..b7ae3af 100644
--- a/src/bear.erl
+++ b/src/bear.erl
@@ -208,7 +208,8 @@ arithmetic_mean(#scan_result{n=N, sumX=Sum}) ->
 geometric_mean(#scan_result{n=N, sumLog=SumLog}) ->
     math:exp(SumLog/N).
 
-harmonic_mean(#scan_result{sumInv=0}) ->
+harmonic_mean(#scan_result{sumInv=Zero}) when Zero =:= 0 orelse
+                                              Zero =:= 0.0 ->
     %% Protect against divide by 0 if we have all 0 values
     0;
 harmonic_mean(#scan_result{n=N, sumInv=Sum}) ->


Mime
View raw message