Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ecvt(III) — UNIX 6th Edition 1.3.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

printf (III)

ECVT(III)  −  PWB/UNIX 4/30/73

NAME

ecvt, fcvt − output conversion

SYNOPSIS

jsrpc,ecvt jsrpc,fcvt char *ecvt(value, ndigit, decpt, sign)
double value;
int ndigit, *decpt, *sign; char *fcvt(value, ndigit, decpt, sign)

DESCRIPTION

Ecvt is called with a floating point number in fr0.  On exit, the number has been converted into a string of ascii digits in a buffer pointed to by r0. The number of digits produced is controlled by a global variable _ndigits.  Moreover, the position of the decimal point is contained in r2: r2=0 means the d.p. is at the left hand end of the string of digits; r2>0 means the d.p. is within or to the right of the string. The sign of the number is indicated by r1 (0 for +; 1 for −). The low order digit has suffered decimal rounding (i. e. may have been carried into). From C, the value is converted and a pointer to a null-terminated string of ndigit digits is returned.  The position of the decimal point is stored indirectly through decpt (negative means to the left of the returned digits).  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 been rounded for F-style output of the number of digits specified by ndigits. 

SEE ALSO

printf (III)

BUGS

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