gcvt

Converts its argument to a null-terminated string of ASCII digits and returns the address of the string.

Format

#include  <stdlib.h>

char *gcvt  (double value, int ndigit, char
            *buffer);
Function Variants This function also has variants named _gcvt32 and _gcvt64 for use with 32-bit and 64-bit pointer sizes, respectively. See Section 1.8 for more information on using pointer-size-specific functions.

Arguments

value
An object of type double that is converted to a null-terminated string of ASCII digits.
ndigit
The number of ASCII digits to use in the converted string. If ndigit is less than 6, the value of 6 is used.
buffer
A storage location to hold the converted string.

Description

This function places the converted string in a buffer and returns the address of the buffer. If possible, gcvt produces ndigit significant digits in F-format, or if not possible, in E-format. Trailing zeros are suppressed.

The ecvt, fcvt, and gcvt functions represent the following special values specified in the IEEE Standard for floating-point arithmetic:
Value  Representation 
Quiet NaN  NaNQ 
Signalling NaN  NaNS 
+Infinity  Infinity 
- Infinity  -Infinity 

The sign associated with each of these values is stored into the sign argument. In IEEE floating-point representation, a value of 0 (zero) can be positive or negative, as set by the sign argument.

See also fcvt and ecvt in this section.

Return Value
The address of the buffer. 


Previous Page | Next Page | Table of Contents | Index