module BigMath
def E(prec)
#=> "0.271828182845904523536028752390026306410273E1"
BigMath::E(10).to_s
digits of precision, +numeric+.
Computes e (the base of natural logarithms) to the specified number of
E(numeric) -> BigDecimal
call-seq:
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 end