diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-05 01:46:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-05 01:46:20 +0000 |
commit | 01fb6694238ba905a08b9331430d234da054cc63 (patch) | |
tree | a4cf53c0c76da949b83523ce16b510f9d09f02d2 /math.c | |
parent | 3ca1cbecc6a22270ca23c4d87d0e15a37c0e8170 (diff) | |
download | ruby-01fb6694238ba905a08b9331430d234da054cc63.tar.gz |
math.c: more accuracy
* math.c (math_log10): calculate log10(2) for more accuracy.
[ruby-core:79907] [Bug #13279]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -563,7 +563,7 @@ math_log10(VALUE unused_obj, VALUE x) /* check for pole error */ if (d == 0.0) return DBL2NUM(-INFINITY); - return DBL2NUM(log10(d) + numbits * M_LN2/M_LN10); /* log10(d * 2 ** numbits) */ + return DBL2NUM(log10(d) + numbits * log10(2)); /* log10(d * 2 ** numbits) */ } /* |