Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

Guardian Native C Library Calls (a - e) ecvt(3)
NAME
ecvt - Converts a floating-point number to a string
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRESRL
G-series native OSS processes: /G/system/sysnn/zcresrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcredll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycredll
SYNOPSIS
#include <stdlib.h>
char *ecvt(
double value,
int ndigit,
int *decpt,
int *sign
);
PARAMETERS
value Is the floating-point number to be converted.
ndigit Is the length of the returned null-terminated string.
decpt Is a pointer to an integer that indicates the position of the radix character
(decimal point) relative to the beginning of the returned string.
sign Is a pointer to an integer that indicates the sign of value.
DESCRIPTION
The ecvt() function converts a floating-point number to a null-terminated string and returns a
pointer to that string.
The resulting string does not actually contain the radix character (decimal point). The position of
the radix character relative to the beginning of the string is stored in the integer pointed to by
decpt. A negative value of decpt indicates that the radix character is to the left of the returned
string. ecvt() also returns an integer indicating the sign of value in the location pointed to by the
sign parameter. If value is negative, the integer is nonzero; otherwise it is 0 (zero). The preci-
sion of the type double limits the total number of characters in the string.
NOTES
This function supports both IEEE Std 754-1985 floating-point and Tandem floating-point values.
IEEE values can include NaN and infinity, and the sign of 0 (zero) can be either positive or nega-
tive. Refer to the fp_class(3) reference page for a description of IEEE value classes.
Guardian functions are available to convert between floating-point formats. Refer to the Guar-
dian Programmers Guide for a discussion of floating-point conversions.
The return value of the ecvt() function points to static data, which will be overwritten by future
calls to the function.
RETURN VALUES
The ecvt() function returns a pointer to a null-terminated string representation of value.
527192-018 Hewlett-Packard Company 1175