picop.cycomplex#

Fast complex helpers.

picop.cycomplex.complex_check(p)#

Return True if p is a complex or subtype (PyComplex_Check). :type p: object :param p:

Return type:

bool

picop.cycomplex.complex_check_exact(p)#

Return True if type(p) is complex (PyComplex_CheckExact). :type p: object :param p:

Return type:

bool

picop.cycomplex.complex_eq(a, b)#

Return True if values are equal with Python complex parity.

Notes

NaN on either real or imag part yields unequal (CPython parity).

Parameters:
Return type:

bool

picop.cycomplex.complex_from_doubles(real, imag)#

Return complex(real, imag) via PyComplex_FromDoubles. :type real: float :param real: :type imag: float :param imag:

Return type:

object

picop.cycomplex.complex_imag_as_double(op)#

Return the imaginary part of op as a C double (PyComplex_ImagAsDouble). :type op: object :param op:

Return type:

float

picop.cycomplex.complex_real_as_double(op)#

Return the real part of op as a C double (PyComplex_RealAsDouble). :type op: object :param op:

Return type:

float