Advanced Functions (GNU MPC 1.3.0)

Next: Internals, Previous: Miscellaneous Functions, Up: Complex Functions [Index]

### 5.12 Advanced Functions

Macro: MPC_SET_X_Y (real_suffix, imag_suffix, rop, real, imag, rnd) ¶

  The macro MPC_SET_X_Y is designed to serve as the body of an assignment function and cannot be used by itself. The real_suffix and imag_suffix parameters are the types of the real and imaginary part, that is, the `x` in the `mpfr_set_x` function one would use to set the part; for the mpfr type, use `fr`. real (respectively imag) is the value you want to assign to the real (resp. imaginary) part, its type must conform to real_suffix (resp. imag_suffix). rnd is the `mpc_rnd_t` rounding mode. The return value is the usual inexact value (see Return Value).

  For instance, you can define mpc_set_ui_fr as follows:

      int mpc_set_ui_fr (mpc_t rop, unsigned long int re, mpfr_t im, mpc_rnd_t rnd)
          MPC_SET_X_Y (ui, fr, rop, re, im, rnd);