benilla-re systems structs docs

__shift

function · crt · orchestration

Address
0x40b84f · 37 bytes, up to 0x40b873
Signature
void __cdecl (char *s, int n)
Meaning
Moves a string and its NUL up by n bytes; nothing for 0
Confidence
verified, proof one
Name from
the community database (idb)
Finding
crt/printf#rounding-the-digit-text
Test
crt::crt_sprintf_float_difftest

Finding: Rounding the digit text in crt: formatted output

_fptostr writes 0 and then n digits of the mantissa text, 0 once the text runs out. For n of 0 or more, when the next mantissa byte is 5 or above as a signed byte, it adds one at the last digit, nines becoming zeros as the carry moves left. A carry into the leading 0 makes it 1 and adds one to the decimal exponent; otherwise the leading 0 is removed. The mantissa of a non-finite value is its text, so %.2f of +∞ rounds I up: 1.#J. For n below 0 the result is empty. __shift moves a string up by n bytes, its NUL included, and does nothing for 0.

The derivation is in the doc.

Callers 2

Callees 2

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