1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/bigdecimal/lib/bigdecimal/math.rb (BigMath#log): improved

precision and performance. [ruby-dev:41295]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-05-12 06:04:59 +00:00
parent cab5124b59
commit 27da0b8982
3 changed files with 11 additions and 4 deletions

View file

@ -1,3 +1,8 @@
Wed May 12 15:04:57 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/bigdecimal/lib/bigdecimal/math.rb (BigMath#log): improved
precision and performance. [ruby-dev:41295]
Tue May 11 14:26:00 2010 Kenta Murata <mrkn@mrkn.jp>
* ext/bigdecimal/lib/bigdecimal/math.rb (atan),

View file

@ -190,8 +190,10 @@ module BigMath
one = BigDecimal("1")
two = BigDecimal("2")
n = prec + BigDecimal.double_fig
if (expo = x.exponent) < 0
if (expo = x.exponent) < 0 || expo >= 3
x = x.mult(BigDecimal("1E#{-expo}"), n)
else
expo = nil
end
x = (x - one).div(x + one,n)
x2 = x.mult(x,n)
@ -206,7 +208,7 @@ module BigMath
y += d
end
y *= two
if expo < 0
if expo
y += log(BigDecimal("10"),prec) * BigDecimal(expo.to_s)
end
y

View file

@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.2"
#define RUBY_RELEASE_DATE "2010-05-11"
#define RUBY_RELEASE_DATE "2010-05-12"
#define RUBY_PATCHLEVEL -1
#define RUBY_VERSION_MAJOR 1
@ -7,7 +7,7 @@
#define RUBY_VERSION_TEENY 1
#define RUBY_RELEASE_YEAR 2010
#define RUBY_RELEASE_MONTH 5
#define RUBY_RELEASE_DAY 11
#define RUBY_RELEASE_DAY 12
#include "ruby/version.h"