cos(z)
Returns the cosine of z, where z is given in radians
CMath.cos(1 + 1i) #=> (0.8337300251311491-0.9888977057628651i)
# File lib/cmath.rb, line 182 def cos(z) begin if z.real? RealMath.cos(z) else Complex(RealMath.cos(z.real) * RealMath.cosh(z.imag), -RealMath.sin(z.real) * RealMath.sinh(z.imag)) end rescue NoMethodError handle_no_method_error end end