Home / Docs / Specification / 29. Numerics

29.6 Determinism

Release v0.4.0

The result of every F64 operation, and every output that depends on one, is bitwise identical in the interpreter and in native code, on every supported target and on every machine.

  1. NaN is canonical outside registers. Every engine replaces a NaN by the canonical NaN at every store, call argument, return value and observation, and after -x, abs and copy_sign (ADR 0114 rule 6.1). The interpreter canonicalizes after every operation whose result is a NaN.

  2. No contraction, no reassociation. a * b + c is two roundings. No engine fuses, reassociates, or assumes that values are not NaN, not infinite or not -0.0. Only fma fuses.

  3. No excess precision. Both targets compute binary64 in binary64 registers.

  4. The environment. Every command that reads a package of edition 0.3 or later (una run, una test, una check, una build, una core, and the language server) first runs a self-test of the floating-point environment: probes, whose inputs no compiler folds, that tell round-to-nearest-even from each of the other rounding modes, by a tie and by a value that is not a tie, and detect flush-to-zero and denormals-are-zero. A failed probe stops the command with U6006, "the floating-point environment of this platform is not the default one (<probe>)", exit code 1, before the package's sources are checked. A native executable of edition 0.3 or later writes the default environment at start and tests it (ADR 0114 rule 6.4). Packages of editions 0.1 and 0.2 never run the self-test.

  5. No platform math library. floor, ceil, trunc, both roundings, rem, fma and the conversions of §4 are the project's own routines, in integer arithmetic on the bits, shared by both engines; sqrt is the IEEE instruction. Every routine returns the canonical NaN for a NaN result.

    (Note of 2026-10-31, #1277.) The rule binds what computes a value of a Una program: both engines, the interpreter's code in una included, the native runtime libuna_rt and every executable that una build links. The Z3 solver built into una (ADR 0124) computes no value of a Una program; its own calls to the platform's math library, in its search heuristics, are allowed in the una binary alone, each by name (scripts/no-libm-una.txt), together with the C++ runtime it loads (scripts/load-commands-una.txt). The build release gate checks that una built without the solver, the runtime and every emitted executable reference none of the math library's names, and that each such name una references is one the solver's library imports (docs/release-gates.md).