pub unsafe extern "C" fn rb_Complex(real: VALUE, imag: VALUE) -> VALUEExpand description
Converts various values into a Complex. This function accepts:
- Instances of ::
rb_cComplex(taken as-is), - Instances of ::
rb_cNumeric(adds0i), - Instances of ::
rb_cString(parses), - Other objects that respond to
#to_c.
It (possibly recursively) applies #to_c until both sides become a Complex
value, then computes imag * 1i + real.
As a special case, passing ::RUBY_Qundef to imag is the same as passing
RB_INT2NUM(0).
@param[in] real Real part (see above).
@param[in] imag Imaginary part (see above).
@exception rb_eTypeError Passed something not described above.
@return An instance of ::rb_cComplex whose value is 1i * imag + real.
@internal
ยงThis was the implementation of Kernel#Complex before, but they diverged.
Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3