[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |

# 6 Rational Number Functions

This chapter describes the GMP functions for performing arithmetic on rational
numbers. These functions start with the prefix `mpq_`

.

Rational numbers are stored in objects of type `mpq_t`

.

All rational arithmetic functions assume operands have a canonical form, and canonicalize their result. The canonical from means that the denominator and the numerator have no common factors, and that the denominator is positive. Zero has the unique representation 0/1.

Pure assignment functions do not canonicalize the assigned variable. It is the responsibility of the user to canonicalize the assigned variable before any arithmetic operations are performed on that variable.

- Function:
*void***mpq_canonicalize***(mpq_t*`op`) Remove any factors that are common to the numerator and denominator of

`op`, and make the denominator positive.

6.1 Initialization and Assignment Functions | ||

6.2 Conversion Functions | ||

6.3 Arithmetic Functions | ||

6.4 Comparison Functions | ||

6.5 Applying Integer Functions to Rationals | ||

6.6 Input and Output Functions |

[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |

This document was generated on *March 31, 2014* using *texi2html 5.0*.