rb_Complex

Function rb_Complex 

Source
pub unsafe extern "C" fn rb_Complex(real: VALUE, imag: VALUE) -> VALUE
Expand description

Converts various values into a Complex. This function accepts:

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