| www.delorie.com/gnu/docs/gmp/gmp_49.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When using any of these functions, it's a good idea to include `stdio.h' before `gmp.h', since that will allow `gmp.h' to define prototypes for these functions.
Passing a NULL pointer for a stream argument to any of these
functions will make them read from stdin and write to stdout,
respectively.
Return the number of bytes written, or if an error occurred, return 0.
The input can be a fraction like `17/63' or just an integer like
`123'. Reading stops at the first character not in this form, and white
space is not permitted within the string. If the input might not be in
canonical form, then mpq_canonicalize must be called (see section 6. Rational Number Functions).
The base can be between 2 and 36, or can be 0 in which case the leading characters of the string determine the base, `0x' or `0X' for hexadecimal, `0' for octal, or decimal otherwise. The leading characters are examined separately for the numerator and denominator of a fraction, so for instance `0x10/11' is 16/11, whereas `0x10/0x11' is 16/17.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |