cmp.to_f â float
Instance Public methods
Returns the value as a float if possible (the imaginary part should be exactly zero).
Complex(1, 0).to_f #=> 1.0 Complex(1, 0.0).to_f # RangeError Complex(1, 2).to_f # RangeError
Returns the value as a float if possible (the imaginary part should be exactly zero).
Complex(1, 0).to_f #=> 1.0 Complex(1, 0.0).to_f # RangeError Complex(1, 2).to_f # RangeError
Please login to continue.