static PyObject * GMPy_MPC_GetImag_Attrib(MPC_Object *self, void *closure) { MPFR_Object *result = NULL; CTXT_Object *context = NULL; CHECK_CONTEXT(context); if ((result = GMPy_MPFR_New(0, context))) { result->rc = mpc_imag(result->f, self->c, GET_MPFR_ROUND(context)); GMPY_MPFR_CLEANUP(result, context, "imag()"); } return (PyObject*)result; }
mpcomplex mpcomplex::Im() const{ mpfr_t imagPart; mpfr_init2(imagPart, mpc_prec); mpc_imag(imagPart, mpc_val , default_rnd ); return mpcomplex(imagPart); }