cmp.abs â real Instance Public methods Returns the absolute part of its polar form. Complex(-1).abs #=> 1 Complex(3.0, -4.0).abs #=> 5.0
cmp.abs2 â real Instance Public methods Returns square of the absolute value. Complex(-1).abs2 #=> 1 Complex(3.0, -4.0).abs2 #=> 25.0
cmp.angle â float Instance Public methods Returns the angle part of its polar form. Complex.polar(3, Math::PI/2).arg #=> 1.5707963267948966
cmp.arg â float Instance Public methods Returns the angle part of its polar form. Complex.polar(3, Math::PI/2).arg #=> 1.5707963267948966
as_json(*) Instance Public methods
cmp.conj â complexcmp.conjugate â complex Instance Public methods Returns the complex conjugate. Complex(1, 2).conjugate #=> (1-2i)
cmp.conjugate â complex Instance Public methods Returns the complex conjugate. Complex(1, 2).conjugate #=> (1-2i)
cmp.denominator â integer Instance Public methods Returns the denominator (lcm of both denominator - real and imag). See numerator.
cmp.fdiv(numeric) â complex Instance Public methods Performs division as each part is a float, never returns a float. Complex(11, 22).fdiv(3) #=> (3.6666666666666665+7.333333333333333i)
cmp.imag â realcmp.imaginary â real Instance Public methods Returns the imaginary part. Complex(7).imaginary #=> 0 Complex(9, -4).imaginary #=> -4
Page 123 of 11844