class method
Math.exp
(::Math::double x) -> ::Float
Math.exp(x) → float
math.c
View on GitHub ↗
static VALUE
math_exp(VALUE unused_obj, VALUE x)
{
return DBL2NUM(exp(Get_Double(x)));
}
Returns e raised to the x power.
-
Domain:
[-INFINITY, INFINITY]. -
Range:
[0, INFINITY].
Examples:
Example
exp(-INFINITY) # => 0.0 exp(-1.0) # => 0.36787944117144233 # 1.0/E exp(0.0) # => 1.0 exp(0.5) # => 1.6487212707001282 # sqrt(E) exp(1.0) # => 2.718281828459045 # E exp(2.0) # => 7.38905609893065 # E**2 exp(INFINITY) # => Infinity