CMath is a library that provides trigonometric and transcendental functions for complex numbers.

## Usage¶ ↑

To start using this library, simply:

require "cmath"

Square root of a negative number is a complex number.

CMath.sqrt(-9) #=> 0+3.0i

Support for the Ruby 2.1 series ended on March 31 2017. See here for details.

**New to Ruby?** You may find these links helpful:
syntax,
control expressions,
assignment,
methods,
modules + classes,
and operator precedence.

CMath is a library that provides trigonometric and transcendental functions for complex numbers.

To start using this library, simply:

require "cmath"

Square root of a negative number is a complex number.

CMath.sqrt(-9) #=> 0+3.0i

Classes

Methods