Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Math.exp

Math.exp(x) → Float

Returns e**x.

Domain: (-INFINITY, INFINITY)

Codomain: (0, INFINITY)

Example
Math.exp(0)       #=> 1.0
Math.exp(1)       #=> 2.718281828459045
Math.exp(1.5)     #=> 4.4816890703380645
See also .erfc .frexp .erf .gamma also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0