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