benilla-re systems structs docs

s_exponentTemplate

global · crt

Address
0x8001e0 · 6 bytes, up to 0x8001e5
Type
char[6]
Meaning
Holds e+000, the exponent __cftoe2 copies and adds the digits into
Confidence
verified, proof one
Finding
crt/printf#the-e-and-f-forms

Finding: The e and f forms in crt: formatted output

_cfltcvt sends e and E to _cftoe, f to _cftof and anything else to _cftog. _cftoe rounds to ndec + 1 digits written after room for the sign and the point, then _cftoe2 writes -, the first digit, the point when ndec is above 0, the rest, and the exponent from the template e+000: E when capital, the decimal exponent less one with its sign and three digits, and +000 for a zero. _cftof rounds to decpt + ndec digits, then _cftof2 writes -, the integer digits or 0, and for ndec above 0 the point, then the zeros a negative exponent puts before the first digit, at most ndec of them, then the digits.

The derivation is in the doc.