Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fcvt(3C) — GL2 W2.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fpsigset(3C)

setfpe(3X)

printf(3S)

ECVT(3C)  —  Silicon Graphics

NAME

ecvt (_d_ecvt), fcvt (_d_fcvt), gcvt (_d_gcvt) − convert floating-point number to string

SYNOPSIS

char ∗ecvt (value, ndigit, decpt, sign)
float value;
int ndigit, ∗decpt, ∗sign;

char ∗_d_ecvt (value, ndigit, decpt, sign)
long float value;
int ndigit, ∗decpt, ∗sign;

char ∗fcvt (value, ndigit, decpt, sign)
float value;
int ndigit, ∗decpt, ∗sign;

char ∗_d_fcvt (value, ndigit, decpt, sign)
long float value;
int ndigit, ∗decpt, ∗sign;

char ∗gcvt (value, ndigit, buf)
float value;
char ∗buf;

char ∗_d_gcvt (value, ndigit, buf)
long float value;
char ∗buf;

DESCRIPTION

Ecvt converts value to a null-terminated string of ndigit digits, returning a pointer to the string.  The low-order digit is rounded.  The position of the decimal point relative to the beginning of the string is stored indirectly through decpt (negative means to the left of the returned digits). The decimal point is not included in the returned string.  If the sign of the result is negative, the word pointed to by sign is non-zero, otherwise it is zero. 

Fcvt is identical to ecvt except that the correct digit has been rounded for Fortran F-format output of the number of digits specified by ndigit.

Gcvt converts the value to a null-terminated string in the array pointed to by buf and returns buf. It attempts to produce ndigit significant digits in Fortran F-format if possible, otherwise E-format, ready for printing. A minus sign, if there is one, or a decimal point will be included as part of the returned string.  Trailing zeros are suppressed. 

The long float versions _d_ecvt, _d_fcvt, and _d_gcvt function the same as the standard entry points, returning the type long float.

DIAGNOSTICS

The functions use standard floating point, and may cause exceptions due to overflow or underflow. 

SEE ALSO

fpsigset(3C) setfpe(3X) printf(3S)

BUGS

The return values point to static data whose content is overwritten by each call. 

Version 2.4  —  May 08, 1986

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026