End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
BigMath#E
E(numeric) → BigDecimal
ext/bigdecimal/lib/bigdecimal/math.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/ext/bigdecimal/lib/bigdecimal/math.rb, line 228
def E(prec)
raise ArgumentError, "Zero or negative precision for E" if prec <= 0
BigMath.exp(1, prec)
end
Computes e (the base of natural logarithms) to the specified number of digits of precision, numeric.
Example
BigMath.E(10).to_s #=> "0.271828182845904523536028752390026306410273e1"