floatparity

command
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Command floatparity generates a deterministic sweep of IEEE-754 doubles in the konareef-toml/v1 R8 range [0.0, 1.0e6], formats each through the Go canonical float rule, and emits the set as JSON for cross-implementation comparison against Erlang.

This harness checks the canonical TOML float formatting contract: confirm whether Go's strconv.FormatFloat and Erlang's :erlang.float_to_binary/2 [short] agree byte-for-byte across the allowed float range. A clean run lets the canonicalizer spec be locked; a divergence forces an explicit float-to-string algorithm.

Pipeline:

go run ./internal/canon/floatparity > samples.json
escript internal/canon/floatparity/parity.erl samples.json

Exit 0 from the Erlang script = full parity. Exit 1 = at least one divergence, printed with the exact IEEE-754 bit pattern that caused it so the failing value can be reproduced bit-identically.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL