Skip to content
class method

Math.exp

(::Math::double x) -> ::Float
Math.exp(x) → float

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
See also .erfc .expm1 .erf .frexp also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0