Skip to content

P3488 R1 Floating-Point Excess Precision #2136

@mattkretz

Description

@mattkretz
Member

P3488R0 Floating-Point Excess Precision (Matthias Kretz)

Activity

mattkretz

mattkretz commented on Nov 1, 2024

@mattkretz
MemberAuthor

This paper addresses #1584

moved this to ready for review in SG6on Nov 1, 2024
moved this from Wroclaw '24 Friday to Wroclaw '24 in SG6on Nov 1, 2024
added
SG6Numerics
and removed
SG6Numerics
EWGEvolution
on Nov 10, 2024
mattkretz

mattkretz commented on Nov 19, 2024

@mattkretz
MemberAuthor

P3488R0: Floating-Point Excess Precision

2024-11-19 SG6 Minutes

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 + x where
x is a double cannot be evaluated as 1.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.

moved this from 2024-11 Wroclaw to forwarded in SG6on Nov 19, 2024
added
EWGEvolution
and removed
SG6Numerics
on Nov 19, 2024
jfbastien

jfbastien commented on Nov 20, 2024

@jfbastien
Collaborator

Seen in EWG on Wednesday:

Poll: CWG2752 / P3488: Floating-Point Excess Precision, FLT_EVAL_METHOD must always be 0.

SF F N A SA
2 5 5 4 4

Result: not consensus

Poll: CWG2752 / P3488: Floating-Point Excess Precision, FLT_EVAL_METHOD can 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

added
SG6Numerics
needs-revisionPaper needs changes before it can proceed
and removed
EWGEvolution
on Nov 20, 2024
wg21bot

wg21bot commented on Dec 18, 2024

@wg21bot
Collaborator

P3488R1 Floating-Point Excess Precision (Matthias Kretz)

added this to the 2025-telecon milestone on Dec 18, 2024
changed the title [-]P3488 Floating-Point Excess Precision[/-] [+]P3488 R1 Floating-Point Excess Precision[/+] on Dec 18, 2024
added
C++29Targeted at C++29
C++26Targeted at C++26
and removed
C++26Targeted at C++26
C++29Targeted at C++29
on Mar 20, 2025
moved this from forwarded to reviewed, needs to come back in SG6on May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C++26Targeted at C++26C++29Targeted at C++29SG6Numericsneeds-revisionPaper needs changes before it can proceed

    Type

    No type

    Projects

    Status

    reviewed, needs to come back

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jfbastien@mattkretz@inbal2l@wg21bot

        Issue actions

          P3488 R1 Floating-Point Excess Precision · Issue #2136 · cplusplus/papers