benilla-re systems structs docs

__cftog

function · crt · primitive

Address
0x40b76b · 147 bytes, up to 0x40b7fd
Signature
char * __cdecl (double *value, char *buffer, int ndec, int caps)
Meaning
Writes a double in the g form: ndec significant digits, the e form by the rounded exponent, else the f form
Confidence
verified, proof one
Name from
the community database (idb)
Finding
crt/printf#the-g-form-and-its-trims
Test
crt::crt_sprintf_float_difftest

Finding: The g form and its trims in crt: formatted output

_cftog rounds to ndec significant digits, then takes the decimal exponent after the rounding, less one: below -4 or at least ndec, the e form with ndec - 1 digits after the point; otherwise the f form, with every zero a negative exponent puts before the first digit, and with the last digit dropped when the rounding carried into a new first digit. _cropzeros, for g without #, removes the zeros before the exponent or the end of the fraction, and the point when no digit is left after it. _forcdecpt, for # with precision 0, puts a point after the leading digits, or before an e that comes first.

The derivation is in the doc.

Callers 1

Callees 4

Calls and jumps by a bare address, from tables/calls.tsv.