Node:Integer Arithmetic, Next:, Previous:Converting Integers, Up:Integer Functions



Arithmetic Functions

void mpz_add (mpz_t rop, mpz_t op1, mpz_t op2) Function
void mpz_add_ui (mpz_t rop, mpz_t op1, unsigned long int op2) Function
Set rop to op1 + op2.

void mpz_sub (mpz_t rop, mpz_t op1, mpz_t op2) Function
void mpz_sub_ui (mpz_t rop, mpz_t op1, unsigned long int op2) Function
void mpz_ui_sub (mpz_t rop, unsigned long int op1, mpz_t op2) Function
Set rop to op1 - op2.

void mpz_mul (mpz_t rop, mpz_t op1, mpz_t op2) Function
void mpz_mul_si (mpz_t rop, mpz_t op1, long int op2) Function
void mpz_mul_ui (mpz_t rop, mpz_t op1, unsigned long int op2) Function
Set rop to op1 times op2.

void mpz_addmul (mpz_t rop, mpz_t op1, mpz_t op2) Function
void mpz_addmul_ui (mpz_t rop, mpz_t op1, unsigned long int op2) Function
Set rop to rop + op1 times op2.

void mpz_submul (mpz_t rop, mpz_t op1, mpz_t op2) Function
void mpz_submul_ui (mpz_t rop, mpz_t op1, unsigned long int op2) Function
Set rop to rop - op1 times op2.

void mpz_mul_2exp (mpz_t rop, mpz_t op1, unsigned long int op2) Function
Set rop to op1 times 2 raised to op2. This operation can also be defined as a left shift by op2 bits.

void mpz_neg (mpz_t rop, mpz_t op) Function
Set rop to -op.

void mpz_abs (mpz_t rop, mpz_t op) Function
Set rop to the absolute value of op.