P3938R1 — Values of floating-point types
(9 items)
SG6, EWG, CWG
The C++ standard does not specify what values floating-point types may represent, leaving many questions unanswered about NaN, infinity, signed zeros, and related concepts. This paper investigates the status quo based on existing wording and implementation practice, then provides normative wording to clarify the floating-point value model, including definitions of signed/unsigned values, negative values, bitwise identity for template argument equivalence, and the meaning of adhering to ISO/IEC 60559. The proposed changes document current implementation behavior rather than introducing new semantics.
- §[lex], diff for [lex.fcon] paragraph 3 example — After applying the diff, std::float32_t x is declared twice in the same scope, making the example ill-formed. The second declaration needs a distinct name. [1]
- §[temp], drafting note — Display text says #8375 but the hyperlink points to pull/8573. The PR number digits are transposed; one of the two must be corrected. [2]
- §[support], drafting note — iec_iec559 is a misspelling of is_iec559, the correct numeric_limits member name used elsewhere in the paper. [3]
- §3.14, example block — "only being only" contains a redundant "only". Remove one instance. [4]
- §3.14, example block — "qNaNs payloads" is ungrammatical; should be "qNaN payloads" with the plural on the noun, not the modifier. [1] [5]
- §3.1, bullet list — "sNan" should be "sNaN" — the N in NaN must be capitalized, consistent with "qNaN" on the same line. [6]
- §3.1, third bullet — Missing preposition "for" before "[numeric.limits]". The parallel structure with earlier bullets requires it. [7]
- §4, Impact on the standard — "The clarify" is a grammar error; should be "To clarify". [8]
References — Anthropic Citations API
[1]
"infinity, qNaN, and sNan, [numeric.limits] to make sense and to have types that adhere to ISO/IEC 60559."
"infinity, qNaN, and sNan, [numeric.limits] to make sense and to have types that adhere to ISO/IEC 60559."
[2]
"The clarify the floating-point specification, a bit of additional wording is required."
"The clarify the floating-point specification, a bit of additional wording is required."
[3]
"The following changes resolve Editorial PR #8375."
"The following changes resolve Editorial PR #8375."
[4]
"The worst possible outcome would be to force implementations to report `iec_iec559` as `false` on WASM."
"The worst possible outcome would be to force implementations to report `iec_iec559` as `false` on WASM."
[5]
"std::float32_t x = 0.0f32; ... std::float32_t x = -0.0f32;"
"std::float32_t x = 0.0f32; ... std::float32_t x = -0.0f32;"
[6]
"Instantiating `f` with two different qNaNs payloads results in two distinct instantiations, despite there only being only one distinct qNaN value"
"Instantiating `f` with two different qNaNs payloads results in two distinct instantiations, despite there only being only one distinct qNaN value"
[7]
chars 89731–89993
"
"
with two different qNaNs payloads results in two distinct
instantiations, despite there only being only one..."
[7]
chars 89731–89993
"
"
with two different qNaNs payloads results in two distinct
instantiations, despite there only being only one..."
[8]
"infinity, qNaN, and sNan, [numeric.limits] to make sense and to have types that adhere to ISO/IEC 60559."
"infinity, qNaN, and sNan, [numeric.limits] to make sense and to have types that adhere to ISO/IEC 60559."
Summary: P3938R1 proposes to define the value representation of floating-point types in the C++ standard by introducing concepts such as significand, exponent, sign, zeros, infinities, and NaNs, and by specifying how these map to the abstract machine. It also resolves several core and library issues related to floating-point semantics. Eight findings were identified, including a duplicate variable declaration that renders a proposed example ill-formed, a transposed PR number in a hyperlink, a misspelled identifier, and several grammatical and typographical errors.
Pipeline: Discovery (Anthropic Opus + Citations API) → Verification Gate (OpenRouter Opus) → Report Writer (OpenRouter Opus)
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.