Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Complex#fdiv

(::Numeric) -> ::Complex
fdiv(numeric) → new_complex

Returns Complex.rect(self.real/numeric, self.imag/numeric):

Example
Complex.rect(11, 22).fdiv(3) # => (3.6666666666666665+7.333333333333333i)
See also #denominator #finite? #conjugate #hash also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0