Go to the first, previous, next, last section, table of contents.


Comparison Functions

Function: int mpq_cmp (mpq_t op1, mpq_t op2)

To determine if two rationals are equal, mpq_equal is faster than mpq_cmp.

Macro: int mpq_cmp_ui (mpq_t op1, unsigned long int num2, unsigned long int den2)

This routine allows that num2 and den2 have common factors.

This function is actually implemented as a macro. It evaluates its arguments multiple times.

Macro: int mpq_sgn (mpq_t op)

This function is actually implemented as a macro. It evaluates its arguments multiple times.

Function: int mpq_equal (mpq_t op1, mpq_t op2)
Return non-zero if op1 and op2 are equal, zero if they are non-equal. Although mpq_cmp can be used for the same purpose, this function is much faster.


Go to the first, previous, next, last section, table of contents.