code wiki / (root) / fp64_parts_test.nx

fp64_parts_test.nx

buildroot/runtime/fp64_parts_test.nx

2797 B87 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

fp64_parts_test.nx -- IEEE 754 binary64 literal-encoding round-trip. Verifies fp64_from_parts produces the correct IEEE 754 bit pattern for common literal values. These are the reference encodings the parser will embed in const Values when it hits TK_FLOAT and the surrounding context wants f64. Canonical patterns cross-referenced against C compilers (printf "%016llx" of *(uint64_t*)&double_val): 0.0 -> 0x0000000000000000 1.0 -> 0x3FF0000000000000 2.0 -> 0x4000000000000000 0.5 -> 0x3FE0000000000000 1.5 -> 0x3FF8000000000000 4.0 -> 0x4010000000000000 8.0 -> 0x4020000000000000 3.14 -> 0x40091EB851EB851F (exact fp64; integer encoder may round by a ULP, so we allow ULP tolerance) 0.1 -> 0x3FB999999999999A (recurring decimal, ULP-close)

dependencies 2 imports · 0 importers

syscalls.nx quant.nx fp64_parts_test.nx

imports: syscalls.nxquant.nx

imported by: nobody (leaf or entry point)

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

main fp64_from_parts ulp_close64

structs

none

consts

none

functions

24func ulp_close64(a: i64, b: i64) -> i64 {
called by 1: main
32func main() -> i64 {