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

Guardian Native C Library Calls (f) fcvt(3)
NAME
fcvt - 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 *fcvt(
double value,
int ndigit,
int *decpt,
int *sign
);
PARAMETERS
value Species the floating-point number to be converted.
ndigit Species the number of characters that follow the position of the radix character
(decimal point) in the returned string.
decpt Species a pointer to an integer that indicates the position of the radix character
(decimal point) relative to the beginning of the returned string.
sign Species a pointer to an integer that indicates the sign of value.
DESCRIPTION
The fcvt() function converts a floating-point number to a null-terminated string and returns a
pointer to that string.
The fcvt() function converts the floating-point number value to a string with ndigit characters
following the radix character (decimal point) and returns a pointer to that string. The resulting
string does not actually contain the radix character. Finally, fcvt() also returns an integer indi-
cating 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 precision of the type double limits the total
number of characters in the string.
NOTES
The fcvt() function can be called only by native processes.
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.0 (zero) can be either positive or
negative. 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.
CAUTIONS
The return value of the fcvt() function points to static data, which will be overwritten by future
calls to this function.
527192-018 Hewlett-Packard Company 27