public Method

Math.log(z)

Redefined to handle a Complex argument.

Source Code

# File complex.rb, line 516
def log(z)
  if Complex.generic?(z) and z >= 0
    log!(z)
  else
    r, theta = z.polar
    Complex(log!(r.abs), theta)
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.