Luna-Flow/floating 0.7.1 provides arbitrary-precision binary, decimal, GDA
decimal, and certified interval arithmetic for MoonBit. Precision, rounding,
special values, status flags, traps, and enclosure semantics are explicit
rather than hidden in process-global state.
- New user: Getting Started
- Choose a package: Package Guide
- Copy a minimal example: Quick Start
- Understand algorithms and boundaries: Architecture
- Check numerical claims: Verification
- See 0.7.1 changes: CHANGELOG
- Read the optimization evidence: 0.7.1 audit
- Other languages: 简体中文 · 日本語
moon add Luna-Flow/floating@0.7.1Import only the packages used by the current MoonBit package:
import {
"Luna-Flow/floating/bin_float"
"Luna-Flow/floating/decimal"
"Luna-Flow/floating/decimal_gda"
"Luna-Flow/floating/ball_float"
}///|
test "floating 0.7.1 quick start" {
let binary = @bin_float.BinFloat::make(
@bin_float.BinCoeff::from_uint64(3UL),
-1,
53,
)
inspect(binary.to_double(), content="1.5")
let context = @decimal.DecimalContext::decimal64()
let (decimal, flags) = @decimal.Decimal::from_string_ctx("12.3400", context)
inspect(decimal.quantum(), content="-4")
inspect(flags.has_error(), content="false")
let interval = @ball_float.BallFloat::from_bounds(
@bin_float.BinFloat::from_int(1, precision=53),
@bin_float.BinFloat::from_int(2, precision=53),
)
inspect(interval.contains(binary), content="true")
}The three values have different contracts: binary is one exact dyadic point,
decimal retains the input quantum, and interval denotes every real value in
[1, 2].
| Requirement | Package | Result model | Documentation |
|---|---|---|---|
| arbitrary-precision dyadic and IEEE binary interchange | bin_float |
value or (value, BinaryFlags) |
API · Tutorial · Design |
| IEEE decimal and DPD/BID interchange | decimal |
value or (value, DecimalFlags) |
API · Tutorial · Design |
| General Decimal Arithmetic status and traps | decimal_gda |
GdaOutcome with defined result and next context |
API · Tutorial · Design · Performance |
| certified real enclosure and IEEE 1788 decorations | ball_float |
bare/decorated interval, optionally with BallFlags |
API · Tutorial · Design · Performance |
| first-error binary pipeline | bin_float_checked |
Result[BinFloat, ArithmeticError] wrapper |
Tutorial |
| accumulated IEEE decimal pipeline | decimal_checked |
value + latest/combined flags + optional certification error | Tutorial |
| sticky/trapping GDA pipeline | decimal_gda_checked |
one threaded GdaOutcome |
Tutorial |
| first-error interval pipeline | ball_float_checked |
Result[BallFloat, ArithmeticError] wrapper |
Tutorial |
| representation-independent observation | semantic |
exact scalar/interval projection | API |
Parser, CLI, benchmark, consistency, and internal/* packages are repository
infrastructure. See the full documentation index before
depending on them as application APIs.
BinFloat,Decimal, andBallFloatexpose certified elementary-function paths with bounded refinement and structured certification failure.- Binary and decimal coefficient kernels use target-specific, exact-fallback dispatch across schoolbook, Karatsuba, Toom-3, NTT, block division, and reciprocal algorithms.
decimalanddecimal_gdaare independent state models: IEEE per-operation flags are not GDA sticky status/traps.ball_floatcovers the declared strict IEEE 1788 phases with bare/decorated intervals, critical-point/pole handling, and conservative total fallbacks.- Benchmarks moved into the unified
bench/*Maremark hierarchy with explicit crossover and regression analysis. - The 0.7.1 optimization audit records exact-kernel, directed-rounding, and interval-monotonicity proofs for the optimized paths.
- The native benchmark artifact covers all four core suites; non-monotonic auto-tune observations remain evidence only until independently replicated.
Detailed claims and exclusions live in package-local evidence pages:
- Binary conformance · performance
- IEEE decimal conformance · performance
- GDA decimal conformance · performance
- Interval conformance · performance
- Elementary capability matrix
Performance thresholds are implementation evidence, not API promises. Passing a pinned finite corpus does not imply support for every operation or every real input.
Run the fast pull-request gate:
just pr 8Useful focused commands:
just fmt
just docs
just gate binary 8
just gate decimal 8
just gate decimal_gda 8
just gate interval 8
just bench bin-float --target native
just bench auto-tune --target nativeUse the parameterized conformance entry point for smoke fixtures, plans, pinned corpora, targets, and phases:
just conformance smoke binary
just conformance run decimal --run-target native --run-target wasm
just conformance run interval --phase trigonometric --strict-supportedOperational corpus details live under
testdata/bin_float,
testdata/decimal, and
testdata/interval.
Before release, run the complete gate:
just ci 8See CONTRIBUTING for contribution rules and Documentation Standard for localization/API snapshot requirements.
Apache-2.0. See LICENSE.