code wiki / (root) / nx_pow10_test.nx

nx_pow10_test.nx

buildroot/runtime/nx_pow10_test.nx

9845 B201 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_pow10_test.nx -- the gate the lane's most load-bearing primitive never had. nx_pow10 sits underneath peptide ionisation (pI), thermal death kinetics (D/z lethality), shelf life, and stability -- four organs whose numbers are only as good as this table. It was tested transitively by all of them and directly by none, which means an error here would have been attributed to whichever caller noticed it first. ===== HOW YOU LIAR-KILL A MATH PRIMITIVE WITH NO ORACLE ========== There is no float reference available to check against, and hand-typed "expected" values would just be a second copy of the same table. So the oracle is the function's OWN FUNCTIONAL EQUATION: 10^a * 10^b = 10^(a+b) Nothing about the table or the interpolation is assumed; the identity has to hold, and the amount by which it fails IS the interpolation error, measured rather than quoted. T5 scans the whole decade for the worst case instead of sampling a point that flatters the implementation. expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_pow10.nx nx_pow10_test.nx

imports: nx_syscalls.nxnx_pow10.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ipow10_q3 ipow10_mantissa_q3 t_puts sys_write t_putn sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_write ↻ iabs ilog10_milli ipow10_mantissa_q3 ↻ ipow10_mantissa_q3 ↻ sys_exit ↻

structs

none

consts

none

functions

26func t_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
27func t_putn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { m = 0 - m; sys_write(1, "-" as *u8, 1) } let t: *u8 = sys_mmap(28); var k: i64 = 0; if m == 0 { t[0] = 48 as u8; k = 1 } while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } var i: i64 = 0; while i < k { bb[i] = t[k - 1 - i]; i = i + 1 } sys_write(1, bb, k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
29func iabs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: main
31func main() -> i64