Next: Power Functions and Logarithm, Previous: Projection and Decomposing Functions, Up: Complex Functions [Index]
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 GNU MPFR library, with only a marginal overhead due to the GNU MPC layer.
For functions taking as input an integer argument
(for example mpc_add_ui
), when this argument is zero,
it is considered as an unsigned (that is, exact in this context)
zero, and we follow the MPFR conventions:
(0) + (+0) = +0, (0) - (+0) = -0, (0) - (+0) = -0, (0) - (-0) = +0.
The same applies for functions taking an argument of type mpfr_t
,
such as mpc_add_fr
, of which the imaginary part is considered
to be an exact, unsigned zero.
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 -op rounded according to rnd. Just changes the sign if rop and op are the same variable.
Set rop to the sum of the elements in the array op of length n, rounded according to rnd.
Set rop to op1 times op2 rounded according to rnd.
Note: for mpc_mul
, in case op1 and op2 have the same value,
use mpc_sqr
for better efficiency.
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+op3, rounded according to rnd, with only one final rounding.
Set rop to the dot product of the elements in the arrays op1 and op2, both of length n, rounded according to rnd.
Set rop to op1/op2 rounded according to rnd.
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.
Set the floating-point number rop to the norm of op (i.e., the square of its absolute value), rounded in the direction rnd.
Set rop to op1 times 2 raised to op2 rounded according to rnd. Just modifies the exponents of the real and imaginary parts by op2 when rop and op1 are identical.
Set rop to op1 divided by 2 raised to op2 rounded according to rnd. Just modifies the exponents of the real and imaginary parts by op2 when rop and op1 are identical.
Next: Power Functions and Logarithm, Previous: Projection and Decomposing Functions, Up: Complex Functions [Index]