Draft Standard

Ribose Standard

•
36813(d) (draft 2026-11-01)
UnitsML specifications — Numeric Contract
CalConnect
Ribose Standard

Draft Standard

Warning for Drafts

This document is not a Ribose Standard. It is distributed for review and comment, and is subject to change without notice and may not be referred to as a Standard. Recipients of this draft are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.





Foreword

This part fixes the numeric law of the series: where exact arithmetic is required, how numbers cross serialization boundaries, which algorithm produces transcendental results and how its version is stamped. Every other part that computes or serializes a number cites this part.


Introduction

Metrology data dies by a thousand float roundings. A conversion declared exact that transits an IEEE-754 double, an author’s 2.10 normalized to 2.1, a coverage factor recomputed by a different library on each platform — each silently invalidates byte-identity between implementations. This part makes numerics a contract: exact where exact is possible, declared and versioned where it is not, and byte-identical at every boundary.

1  Scope

This document specifies: exact rational arithmetic requirements; decimal-string representation; the t-quantile algorithm and its versioning; rounding rules; and the byte-identical JSON serialization contract for conformance corpora and evaluator output.

This document does not define when to compute (Parts 4, 5 and the evaluation parts of the Plurimath series decide that); it defines how any computation in the series must behave numerically.

2  Normative references

The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.

CalConnect 36812, (requirement language, artifact discipline)

CalConnect 36819, (vector format, tolerance conventions)

JCGM 101:2008, INTERNATIONAL ORGANIZATION FOR STANDARDIZATION, ORGANISATION INTERNATIONALE DE NORMALISATION (ISO), INTERNATIONAL ELECTROTECHNICAL COMMISSION, COMMISSION ÉLECTROTECHNIQUE INTERNATIONALE (IEC), INTERNATIONAL ORGANIZATION OF LEGAL METROLOGY, ORGANISATION INTERNATIONALE DE MÉTROLOGIE LÉGALE (OIML), INTERNATIONAL UNION OF PURE AND APPLIED CHEMISTRY, UNION INTERNATIONALE DE CHIMIE PURE ET APPLIQUÉE (IUPAC), INTERNATIONAL UNION OF PURE AND APPLIED PHYSICS, UNION INTERNATIONALE DE PHYSIQUE PURE ET APPLIQUÉE (IUPAP), INTERNATIONAL FEDERATION OF CLINICAL CHEMISTRY AND LABORATORY MEDICINE, FÉDÉRATION INTERNATIONALE DE CHIMIE CLINIQUE ET DE BIOLOGIE MOLÉCULAIRE (IFCC), INTERNATIONAL LABORATORY ACCREDITATION COOPERATION, COOPÉRATION INTERNATIONALE D’ACCRÉDITATION DES LABORATOIRES (ILAC), and BUREAU INTERNATIONAL DES POIDS ET MESURES (BIPM). Supplement 1 to the “Guide to the expression of uncertainty in measurement” — Propagation of distributions using a Monte Carlo method. Report no. JCGM 101:2008. First edition. Paris: International Bureau of Weights and Measures, Bureau international des poids et mesures; International Organization for Standardization, Organisation internationale de normalisation; International Electrotechnical Commission, Commission électrotechnique internationale, 2008. Available from: https://www.bipm.org/documents/20126/2071204/JCGM_101_2008_E.pdf/325dcaad-c15a-407c-1105-8b7f322d651c.

3  Terms and definitions

No terms and definitions are listed in this document.

exact decimal

a decimal string preserved verbatim from its source; trailing zeros are significant (2.10 ≠ 2.1).

guard digits

the declared number of extra digits carried beyond the published precision of a non-exact result.

reproducibility class

byte-exact or distributional (CalConnect 36819).

numeric algorithm stamp

the identity and version of the algorithm producing a non-exact result (Clause 7).

4  Conventions

Requirement language per CalConnect 36812. All examples in this part show serialized decimal strings, not internal representations.

5  Exact rational arithmetic

Conversions declared exact="true" (CalConnect 36816, scale and difference arithmetic (CalConnect 36815, Type A statistics, and all rational operations of propagation are computed in exact rational arithmetic; an implementation never rounds an intermediate exact value.

Irrational results — square roots of non-square rationals, Student-t quantiles — are computed by the declared algorithm of Clause 7 or refused — never through a floating-point shortcut.

EXAMPLE 1

Expected outcome. Converting 32 °F to kelvin: the factor 5/9 and the offset arithmetic run in rationals; the serialized result is exactly "273.15". A float path would emit platform-dependent digits at the tail.

EXAMPLE 2

Refusal expected. sqrt over a non-square rational factor in a canonical decomposition has no exact rational result; the conversion of such a synthetic unit is refused with a typed error, not approximated.

6  Decimal-string representation

Numbers crossing a serialization boundary are decimal strings. IEEE-754 values never appear in any artifact, corpus or API result of this series. Decimal strings preserve:

  • the author’s text verbatim in record positions — rounding is the author’s act (JCGM 100:2008, 7.2.2);

  • the exact rational value elsewhere: integer strings for integral rationals, p/q rationals where the register uses them, and fixed-decimal strings with declared guard digits for non-exact results.

EXAMPLE 1

Verbatim preservation. The author writes 2.10; the record, every render and every vector carry "2.10". "2.1" is a different author text and never replaces it.

EXAMPLE 2

Register rationals. The register carries the litre as factor: '0.001' and degree Fahrenheit as factor: 5/9, offset: 229835/900 — exact by construction. Conforming conversions reproduce these strings on round-trip.

7  The t-quantile algorithm

Coverage factors from the Student-t distribution at probability p with ν degrees of freedom are computed by Newton iteration on the regularized incomplete beta function at fixed precision, with a published monotone error bound. The algorithm identity and version are stamped in every result and vector metadata (numeric_algorithm).

EXAMPLE

Expected outcome. For p = 0.95, ν = 16: k = 2.119905…, published to the vector’s declared decimals with numeric_algorithm: "unitsml-t-newton-1". A conforming TypeScript runtime emits the same bytes as the Ruby reference for the same stamp. Substituting a table-based or library quantile without restamping is non-conforming.

8  Rounding

  • Record nodes: no rounding by the implementation; author text is preserved verbatim.

  • Vectors: published at the fixed decimal places declared per vector.

  • Presentation: rounding is a presentation decision and never feeds back into stored values.

EXAMPLE

Interpretation. An evaluator computing u_c = 34.1839… nm for a vector declaring three decimals publishes "34.184"; the stored record meanwhile keeps whatever text the author wrote. Neither the author text nor the vector is altered by the presentation layer’s choice to display 34 µm.

9  Serialization contract

JSON output of conformance replays and evaluator APIs are: UTF-8; fixed key order (lexicographic, defined once per schema); decimal strings for all numerics; stamped with engine_version, grammar_version, vector_set_version, numeric_algorithm. Two conforming implementations given the same input emit byte-identical output.

EXAMPLE

Byte-identity. Given the same conversion input, the Ruby and TypeScript runtimes emit identical JSON including key order and the trailing digits of "127/25000"-class rationals. Any byte difference is vector drift and blocks the release (CalConnect 36819).

10  Conformance

This part is enforced by every vector of CalConnect 36819: byte-identical replay is the test. Class coverage: any claimed class implies this part. Additional test-suite examples are given in Annex A.


Annex A
(normative)

Annex (informative): additional test-suite examples

EXAMPLE 1

Exact flag discipline. exact="false" percent-per-degree (0.5729577951308232087679815481): the result carries the declared digits, the vector declares tolerance_d, and the output contains no exact marker.

EXAMPLE 2

No float leakage. Grep gate: no serialized corpus artifact contains a decimal exponent form (e-17) originating from a binary double; guard-digit strings only.

EXAMPLE 3

Stamp integrity. Two vectors with differing numeric_algorithm stamps are never byte-compared against each other; the harness rejects the cross-stamp comparison.


Bibliography

[1]  JCGM 100:2008, INTERNATIONAL ORGANIZATION FOR STANDARDIZATION, ORGANISATION INTERNATIONALE DE NORMALISATION (ISO), INTERNATIONAL ELECTROTECHNICAL COMMISSION, COMMISSION ÉLECTROTECHNIQUE INTERNATIONALE (IEC), INTERNATIONAL ORGANIZATION OF LEGAL METROLOGY, ORGANISATION INTERNATIONALE DE MÉTROLOGIE LÉGALE (OIML), INTERNATIONAL UNION OF PURE AND APPLIED CHEMISTRY, UNION INTERNATIONALE DE CHIMIE PURE ET APPLIQUÉE (IUPAC), INTERNATIONAL UNION OF PURE AND APPLIED PHYSICS, UNION INTERNATIONALE DE PHYSIQUE PURE ET APPLIQUÉE (IUPAP), INTERNATIONAL FEDERATION OF CLINICAL CHEMISTRY AND LABORATORY MEDICINE, FÉDÉRATION INTERNATIONALE DE CHIMIE CLINIQUE ET DE BIOLOGIE MOLÉCULAIRE (IFCC), INTERNATIONAL LABORATORY ACCREDITATION COOPERATION, COOPÉRATION INTERNATIONALE D’ACCRÉDITATION DES LABORATOIRES (ILAC), and BUREAU INTERNATIONAL DES POIDS ET MESURES (BIPM). Guide to the expression of uncertainty in measurement. Report no. JCGM 100:2008. First edition. Paris: International Bureau of Weights and Measures, Bureau international des poids et mesures; International Organization for Standardization, Organisation internationale de normalisation; International Electrotechnical Commission, Commission électrotechnique internationale, 2008. Available from: https://www.bipm.org/documents/20126/2071204/JCGM_100_2008_E.pdf/cb0ef43f-baa5-11cf-3f85-4dcd86f77bd6.

[2]  ISO 80000-1, INTERNATIONAL ORGANIZATION FOR STANDARDIZATION (ISO). Quantities and units — Part 1: General. Report no. 80000. Second edition. Geneva: International Organization for Standardization, Available from: https://www.iso.org/standard/76921.html.