You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/07/31 23:10:02 UTC

[11/30] bear commit: updated refs/heads/import-master to 5f99806

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 <ji...@adroll.com>
Authored: Mon Jul 1 09:04:00 2013 -0700
Committer: James Kelly <ji...@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.