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


Initialization and Assignment Functions

Function: void mpq_init (mpq_t dest_rational)
Initialize dest_rational and set it to 0/1. Each variable should normally only be initialized once, or at least cleared out (using the function mpq_clear) between each initialization.

Function: void mpq_clear (mpq_t rational_number)
Free the space occupied by rational_number. Make sure to call this function for all mpq_t variables when you are done with them.

Function: void mpq_set (mpq_t rop, mpq_t op)
Assign rop from op.

Function: void mpq_set_ui (mpq_t rop, unsigned long int op1, unsigned long int op2)
Function: void mpq_set_si (mpq_t rop, signed long int op1, unsigned long int op2)
Set the value of rop to op1/op2. Note that if op1 and op2 have common factors, rop has to be passed to mpq_canonicalize before any operations are performed on rop.


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