Skip to content

Commit 94deded

Browse files
tompngmrkn
andcommitted
Name 0.3010299956639812 as lg2
Co-authored-by: Kenta Murata <3959+mrkn@users.noreply.github.com>
1 parent 696535c commit 94deded

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/bigdecimal.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ def self.log(x, prec)
193193
# https://github.com/ruby/bigdecimal/pull/343
194194
sqrt_steps /= 10
195195

196-
prec2 = prec + [-x_minus_one_exponent, 0].max + (sqrt_steps * 0.3010299956639812).ceil
196+
lg2 = 0.3010299956639812
197+
prec2 = prec + [-x_minus_one_exponent, 0].max + (sqrt_steps * lg2).ceil
197198

198199
sqrt_steps.times do
199200
x = x.sqrt(prec2)

0 commit comments

Comments
 (0)