diff --git a/crates/ailang-core/src/canonical.rs b/crates/ailang-core/src/canonical.rs index 8ab7a0e..953bd50 100644 --- a/crates/ailang-core/src/canonical.rs +++ b/crates/ailang-core/src/canonical.rs @@ -9,9 +9,14 @@ //! The single entry point is [`to_bytes`]. This module deliberately //! does **not** parse, validate, or hash — it only emits bytes. It also //! does not attempt to be a general-purpose canonical-JSON library; -//! number-formatting follows whatever `serde_json::Number::to_string` -//! does, which is fine for the AILang AST (integers and short strings; -//! no floats). +//! Number formatting follows whatever `serde_json::Number::to_string` +//! does — used only for the AST integer literals. Float literals do +//! not go through the number path; [`crate::ast::Literal::Float`] +//! carries its IEEE-754 bit pattern as a `u64` and serialises via a +//! 16-character lowercase hex *string*, which the canonical writer +//! treats like any other string. The string path is what makes float +//! canonical bytes bit-stable across `serde_json` versions and what +//! lets NaN / ±Inf round-trip at all (they cannot, as JSON numbers). //! //! # Examples //!