End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Complex#rect
cmp.rect → array
complex.c
View on GitHub ↗
static VALUE
nucomp_rect(VALUE self)
{
get_dat1(self);
return rb_assoc_new(dat->real, dat->imag);
}
Alias of #rectangular
Returns a complex object which denotes the given rectangular form.
Example
Complex.rectangular(1, 2) #=> (1+2i)