End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Complex#imag
cmp.imag → real
complex.c
View on GitHub ↗
VALUE
rb_complex_imag(VALUE self)
{
get_dat1(self);
return dat->imag;
}
Alias of #imaginary
Returns the imaginary part.
Example
Complex(7).imaginary #=> 0 Complex(9, -4).imaginary #=> -4