If str is NULL
, space for the mantissa is allocated using the default
allocation function.
If str is not NULL
, it should point to a block of storage enough large
for the mantissa, i.e., n_digits + 2. The two extra bytes are for a
possible minus sign, and for the terminating null character.
The exponent is written through the pointer expptr.
If n_digits is 0, the maximum number of digits meaningfully achievable
from the precision of op will be generated. Note that the space
requirements for str in this case will be impossible for the user to
predetermine. Therefore, you need to pass NULL
for the string argument
whenever n_digits is 0.
The generated string is a fraction, with an implicit radix point immediately to the left of the first digit. For example, the number 3.1416 would be returned as "31416" in the string and 1 written at expptr.
A pointer to the result string is returned. This pointer will will either
equal str, or if that is NULL
, will point to the allocated storage.
Go to the first, previous, next, last section, table of contents.