4030. Clarify whether arithmetic expressions in [numeric.sat.func] are mathematical or C++

Section: 26.10.17.1 [numeric.sat.func] Status: WP Submitter: Thomas Köppe Opened: 2023-12-18 Last modified: 2024-04-02

Priority: Not Prioritized

View all issues with WP status.

Discussion:

During the application of P0543R0, "Saturation arithmetic", it was pointed out that it might not be entirely clear what we want something like "x + y" to mean. The paper does not suggest any formatting for those symbols, and a non-normative note explains that the intention is for the expression to be considered mathematically.

I wonder if this is clear enough. Notes are not normative, and the document "shall be usable without notes". I have formatted this as $\tcode{x} + \tcode{y}$ throughout, i.e. the variables are in code font, but the symbol is maths, not code. This is quite subtle. (See also GitHub discussion.)

I think it would be an improvement if we simply made the note not be a note. It seems to contain entirely reasonable, mandatory content.

[2024-03-11; Reflector poll]

Set status to Tentatively Ready after six votes in favour during reflector poll.

[Tokyo 2024-03-23; Status changed: Voting → WP.]

Proposed resolution:

This wording is relative to N4971.

  1. Modify 26.10.17.1 [numeric.sat.func] as indicated:

    -1- [Note 1: In the following descriptions, an arithmetic operation is performed as a mathematical operation with infinite range and then it is determined whether the mathematical result fits into the result type. end note]