couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [11/30] bear commit: updated refs/heads/import-master to 5f99806
Date Thu, 31 Jul 2014 21:10:02 GMT
Add math_log/1 and inverse/1 patterns to catch 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/49cec9a2
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-bear/tree/49cec9a2
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-bear/diff/49cec9a2

Branch: refs/heads/import-master
Commit: 49cec9a27a4e425a1fbe28c925589acdda200769
Parents: 3fd09d1
Author: James Kelly <jim@adroll.com>
Authored: Mon Jul 1 09:04:00 2013 -0700
Committer: James Kelly <jim@adroll.com>
Committed: Mon Jul 1 09:04:00 2013 -0700

----------------------------------------------------------------------
 src/bear.erl | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-bear/blob/49cec9a2/src/bear.erl
----------------------------------------------------------------------
diff --git a/src/bear.erl b/src/bear.erl
index 7039910..ffc9025 100644
--- a/src/bear.erl
+++ b/src/bear.erl
@@ -317,12 +317,16 @@ foldl2(_F, Acc, [], []) ->
 %% wrapper for math:log/1 to avoid dividing by zero
 math_log(0) ->
     1;
+math_log(0.0) ->
+    1.0;
 math_log(X) ->
     math:log(X).
 
 %% wrapper for calculating inverse to avoid dividing by zero
 inverse(0) ->
     0;
+inverse(0.0) ->
+    0.0;
 inverse(X) ->
     1/X.
 


Mime
View raw message