Repository navigation
P3488 R1 Floating-Point Excess Precision #2136
Description
Activity
- addedSG6NumericsNumericsEWGEvolutionEvolutionC++26Targeted at C++26Targeted at C++26
on Nov 1, 2024 This paper addresses #1584
P3488R0: Floating-Point Excess Precision
Chair: Matthias Kretz
Champion: Matthias Kretz
Polls
POLL: Constant expressions (not constant folding) may not use greater
precision and range than the type. => Reproducibility in constant expressions.
If you need more precision and range use std::float128_t in constant
expressions.SF F N A SA 4 2 0 0 0 # of Participants: 6
Outcome: Strong consensus.POLL: Constant folding behavior follows runtime evaluation behavior.
SF F N A SA 5 1 0 0 0 # of Participants: 6
Outcome: Strong consensus.POLL: Literals are always rounded to their types. (Never can a higher
precision and range value be used in subsequent operations.1.1f + xwhere
xis adoublecannot be evaluated as1.1 + x.)SF F N A SA 3 3 0 0 0 # of Participants: 6
Outcome: Strong consensus.POLL: We should consider not allowing excess precision in runtime
evaluation at all (except if we introduce an "attribute" that controls this, as
documented in 60559). Every binary operation on floating-point is rounded once
to the precision and range of its type (decltype(expr)).SF F N A SA 2 3 0 1 0 # of Participants: 6
Outcome: Consensus in favor.POLL: Excess precision in runtime evaluation should be a permissible
optimization for implementations. The implementation choice of what
intermediate type was used is reflected by FLT_EVAL_METHOD (potentially as a
different trait or with the extended values as defined in C23 Annex H).SF F N A SA 1 2 1 2 0 # of Participants: 6
Outcome: No consensus.POLL: Comparison operators should always round their operands to the
precision and range of their types in case excess precision is used. In
addition to operators we expect the<cmath>comparison functions to have the
same behavior (std::isless(a, b)etc...)SF F N A SA 3 0 2 0 1 # of Participants: 6
Outcome: No consensus.
SA: Not worth differing from C in this. x87 does comparison on long double
types.Seen in EWG on Wednesday:
Poll: CWG2752 / P3488: Floating-Point Excess Precision,
FLT_EVAL_METHODmust always be0.SF F N A SA 2 5 5 4 4 Result: not consensus
Poll: CWG2752 / P3488: Floating-Point Excess Precision,
FLT_EVAL_METHODcan have any value allowed by C (this poll requires fixing some Core wording).SF F N A SA 0 5 8 4 4 Result: not consensus
3 remaining items
P3488R1 Floating-Point Excess Precision (Matthias Kretz)
- removedneeds-revisionPaper needs changes before it can proceedPaper needs changes before it can proceed
on Dec 18, 2024 - changed the title
[-]P3488 Floating-Point Excess Precision[/-][+]P3488 R1 Floating-Point Excess Precision[/+]on Dec 18, 2024 - addedC++29Targeted at C++29Targeted at C++29C++26Targeted at C++26Targeted at C++26and removedC++26Targeted at C++26Targeted at C++26C++29Targeted at C++29Targeted at C++29
on Mar 20, 2025 - addedneeds-revisionPaper needs changes before it can proceedPaper needs changes before it can proceed
on May 30, 2025 clearly this won't be c++26
Reacted by Matthias Kretz
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsreviewed, needs to come back
P3488R0 Floating-Point Excess Precision (Matthias Kretz)