consistency API

Purpose

consistency is a white-box test package. It exports no MoonBit items; its content is a suite of about 250 deterministic tests (28 in api_audit_wbtest.mbt and 228 in core_wbtest.mbt on the current branch) that check laws across the packages of floating: that the binary, decimal, GDA and interval cores, their checked wrappers, semantic, and the shared internal helpers agree with each other and with exact BigInt and rational oracles. This page records the package’s role and its (empty) interface; the tutorial shows how to run and extend it and the design page explains what is checked.

Importing

Nothing can be imported from consistency. It is a package of the tools module Luna-Flow/floating-tools; its moon.pkg imports the cores of the library for white-box tests only:

import {
  "Luna-Flow/arithmetic" @lf_arith,
  "Luna-Flow/luna-generic" @lf_alg,
  "Luna-Flow/floating/binary",
  "Luna-Flow/floating/binary_checked",
  "Luna-Flow/floating/decimal",
  "Luna-Flow/floating/decimal_checked",
  "Luna-Flow/floating/decimal_gda",
  "Luna-Flow/floating/decimal_gda_checked",
  "Luna-Flow/floating/interval",
  "Luna-Flow/floating/interval_checked",
  "Luna-Flow/floating/def",
  "Luna-Flow/floating/internal",
  "Luna-Flow/floating-tools/semantic",
} for "wbtest"

Test files

FileContent
api_audit_wbtest.mbtaudits of public behaviour that spans packages: def predicates, internal rounding and parsing helpers, error and context types, the decimal interchange facade (bit-exact encodings, canonical predicates, sign operations), checked compare of binary, generic checked traits through Luna-Flow/arithmetic, and the semantic interpretation of binary, decimal and interval values
core_wbtest.mbtcross-package arithmetic laws: internal digit and trimming helpers against BigInt, binary exactness on dyadics and generic trait use, decimal and decimal_gda cohort, signed-zero and NaN-payload rules (many rows taken from the official decTest suite), interval enclosure properties, checked-pipeline closure, and total constructors
bin_coeff_migration_wbtest.mbthelpers that build Binary values from BigInt for the tests above

All tests are white-box (*_wbtest.mbt) and import every core package for wbtest only, so the package adds nothing to any build of the library.

Complete public interface

The package exports no MoonBit items.

// Generated using `moon info`, DON'T EDIT IT
package "Luna-Flow/floating-tools/consistency"

// Values

// Errors

// Types and methods

// Type aliases

// Traits