Node:Rational Conversions, Next:Rational Arithmetic, Previous:Initializing Rationals, Up:Rational Number Functions
double mpq_get_d (mpq_t op) | Function |
Convert op to a double .
|
void mpq_set_d (mpq_t rop, double op) | Function |
void mpq_set_f (mpq_t rop, mpf_t op) | Function |
Set rop to the value of op, without rounding. |
char * mpq_get_str (char *str, int base, mpq_t op) | Function |
Convert op to a string of digits in base base. The base may vary
from 2 to 36. The string will be of the form num/den , or if the
denominator is 1 then just num .
If str is If str is not mpz_sizeinbase (mpq_numref(op), base) + mpz_sizeinbase (mpq_denref(op), base) + 3 The three extra bytes are for a possible minus sign, possible slash, and the null-terminator. A pointer to the result string is returned, being either the allocated block, or the given str. |