summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/bigdecimal/lib/bigdecimal/math.rb15
1 files changed, 1 insertions, 14 deletions
diff --git a/ext/bigdecimal/lib/bigdecimal/math.rb b/ext/bigdecimal/lib/bigdecimal/math.rb
index 4504ccb2b01..907d3b38293 100644
--- a/ext/bigdecimal/lib/bigdecimal/math.rb
+++ b/ext/bigdecimal/lib/bigdecimal/math.rb
@@ -226,19 +226,6 @@ module BigMath
#
def E(prec)
raise ArgumentError, "Zero or negative precision for E" if prec <= 0
- n = prec + BigDecimal.double_fig
- one = BigDecimal("1")
- y = one
- d = y
- z = one
- i = 0
- while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0)
- m = BigDecimal.double_fig if m < BigDecimal.double_fig
- i += 1
- z *= i
- d = one.div(z,m)
- y += d
- end
- y
+ BigMath.exp(1, prec)
end
end