DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK

# (gmp.info.gz) Rational Arithmetic

Info Catalog (gmp.info.gz) Rational Conversions (gmp.info.gz) Rational Number Functions (gmp.info.gz) Comparing Rationals
```
Arithmetic Functions
====================

- Function: void mpq_sub (mpq_t DIFFERENCE, mpq_t MINUEND, mpq_t
SUBTRAHEND)
Set DIFFERENCE to MINUEND - SUBTRAHEND.

- Function: void mpq_mul (mpq_t PRODUCT, mpq_t MULTIPLIER, mpq_t
MULTIPLICAND)
Set PRODUCT to MULTIPLIER times MULTIPLICAND.

- Function: void mpq_mul_2exp (mpq_t ROP, mpq_t OP1, unsigned long int
OP2)
Set ROP to OP1 times 2 raised to OP2.

- Function: void mpq_div (mpq_t QUOTIENT, mpq_t DIVIDEND, mpq_t
DIVISOR)
Set QUOTIENT to DIVIDEND/DIVISOR.

- Function: void mpq_div_2exp (mpq_t ROP, mpq_t OP1, unsigned long int
OP2)
Set ROP to OP1 divided by 2 raised to OP2.

- Function: void mpq_neg (mpq_t NEGATED_OPERAND, mpq_t OPERAND)
Set NEGATED_OPERAND to -OPERAND.

- Function: void mpq_abs (mpq_t ROP, mpq_t OP)
Set ROP to the absolute value of OP.

- Function: void mpq_inv (mpq_t INVERTED_NUMBER, mpq_t NUMBER)
Set INVERTED_NUMBER to 1/NUMBER.  If the new denominator is zero,
this routine will divide by zero.

```
Info Catalog (gmp.info.gz) Rational Conversions (gmp.info.gz) Rational Number Functions (gmp.info.gz) Comparing Rationals
automatically generated byinfo2html