exp(z)
Math::E raised to the z power
CMath.exp(1.i * Math::PI) #=> (-1.0+1.2246467991473532e-16i)
# File lib/cmath.rb, line 62 def exp(z) begin if z.real? RealMath.exp(z) else ere = RealMath.exp(z.real) Complex(ere * RealMath.cos(z.imag), ere * RealMath.sin(z.imag)) end rescue NoMethodError handle_no_method_error end end