All the following functions are designed in such a way that, when working with real numbers instead of complex numbers, their complexity should essentially be the same as with the MPFR library, with only a marginal overhead due to the MPC layer.
Set rop to op1 + op2 rounded according to rnd.
Set rop to op1 − op2 rounded according to rnd. For
mpc_ui_ui_sub
, op1 is re1 + im1.
Set rop to op1 times op2 rounded according to rnd.
Set rop to op times the imaginary unit i if sgn is non-negative, set rop to op times -i otherwise, in both cases rounded according to rnd.
Set rop to the square of op rounded according to rnd.
Set rop to op1/op2 rounded according to rnd. For
mpc_div
andmpc_ui_div
, the return value may fail to recognize some exact results. The sign of returned value is significant only formpc_div_ui
.
Set rop to −op rounded according to rnd. Just changes the sign if rop and op are the same variable.
Set rop to the conjugate of op rounded according to rnd. Just changes the sign of the imaginary part if rop and op are the same variable.
Set the floating-point number rop to the absolute value of op, rounded in the direction rnd. The returned value is zero iff the result is exact.
Set the floating-point number rop to the norm of op (i.e., the square of its absolute value), rounded in the direction rnd. The returned value is zero iff the result is exact. Note that the destination is of type
mpfr_t
, notmpc_t
.