Add C-371 (Float32 arithmetic rounds to binary32) and C-372 (Float32 shortest display) - #118
Merged
Merged
Conversation
…shortest display) with ALS-T28/T29, their fixtures, and binary32 semantics in the ref Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds two contracts for almide#3080, almide#3082, almide#3079 and almide#3081. The implementation PRs in almide/almide will declare them after the pin advances.
+ - * / % **and unary-result is rounded to binary32 (round-to-nearest-even), on every leg.**is the vendored libm pow of the widened operands, rounded once.math.*function takes a Float32.spec/wasm_cross/float32_arithmetic_rounds.almd.f32Display)..0(C-011's rule);float32.to_stringkeeps it.spec/wasm_cross/float32_display_shortest.almd.Ref evaluator.
+ - * / % **, unary-, comparisons and==, with a bare float literal operand narrowed to Float32.float.to_float32andfloat32.to_float64.float32.to_stringin the shortest-f32 form. These run the existing free-format digit generator over the f32 significand and exponent.2^-12prints0.00024414063;1669760939663944.25prints...944.3), so the generator now does the same. The f64 tie case is added to the oracle test.ref/tests/fmt_oracle.rs::f32_display_matches_host_shortestcompares the ref against the host f32 Display over every f32 biased exponent (with the significand edges, both signs) and 3,000 pseudo-random patterns: 6,584 values, all equal.Checked locally.
check-ref-totality,check-ref-independence, and the ref'scargo test.