Power Functions and Logarithm (GNU MPC 1.2.1)

Next: Trigonometric Functions, Previous: Basic Arithmetic, Up: Complex Functions [Index]

### 5.8 Power Functions and Logarithm

Function: int mpc_sqrt (mpc_t rop, const mpc_t op, mpc_rnd_t rnd)

  Set rop to the square root of op rounded according to rnd. The returned value rop has a non-negative real part, and if its real part is zero, a non-negative imaginary part.

Function: int mpc_pow (mpc_t rop, const mpc_t op1, const mpc_t op2, mpc_rnd_t rnd)
Function: int mpc_pow_d (mpc_t rop, const mpc_t op1, double op2, mpc_rnd_t rnd)
Function: int mpc_pow_ld (mpc_t rop, const mpc_t op1, long double op2, mpc_rnd_t rnd)
Function: int mpc_pow_si (mpc_t rop, const mpc_t op1, long op2, mpc_rnd_t rnd)
Function: int mpc_pow_ui (mpc_t rop, const mpc_t op1, unsigned long op2, mpc_rnd_t rnd)
Function: int mpc_pow_z (mpc_t rop, const mpc_t op1, const mpz_t op2, mpc_rnd_t rnd)
Function: int mpc_pow_fr (mpc_t rop, const mpc_t op1, const mpfr_t op2, mpc_rnd_t rnd)

  Set rop to op1 raised to the power op2, rounded according to rnd. For `mpc_pow_d`, `mpc_pow_ld`, `mpc_pow_si`, `mpc_pow_ui`, `mpc_pow_z` and `mpc_pow_fr`, the imaginary part of op2 is considered as +0. When both op1 and op2 are zero, the result has real part 1, and imaginary part 0, with sign being the opposite of that of op2.

Function: int mpc_exp (mpc_t rop, const mpc_t op, mpc_rnd_t rnd)

  Set rop to the exponential of op, rounded according to rnd with the precision of rop.

Function: int mpc_log (mpc_t rop, const mpc_t op, mpc_rnd_t rnd)
Function: int mpc_log10 (mpc_t rop, const mpc_t op, mpc_rnd_t rnd)

  Set rop to the natural and base-10 logarithm of op respectively, rounded according to rnd with the precision of rop. The principal branch is chosen, with the branch cut on the negative real axis, so that the imaginary part of the result lies in ]-Pi , Pi] and ]-Pi/log(10) , Pi/log(10)] respectively.

Function: int mpc_rootofunity (mpc_t rop, unsigned long int n, unsigned long int k, mpc_rnd_t rnd)

  Set rop to the standard primitive n-th root of unity raised to the power k, that is, exp (2 Pi i k / n), rounded according to rnd with the precision of rop.

Next: Trigonometric Functions, Previous: Basic Arithmetic, Up: Complex Functions [Index]