Skip to content

CWG2752 Excess-precision floating-point literals  #1584

@jensmaurer

Description

@jensmaurer

In C23, floating-point literals (called "constants" there) can be represented with excess precision, meaning a float literal is treated as a double or long double value (without affecting the type system, though).

In C++, there is no such permission.

Both C++ and C permit floating-point computations (including operands) to use excess precision. A footnote hints that a conversion will drop the excess precision (e.g. (float)(314.f/100.f) yields a value with float precision) (like C does), but there is no normative wording to make that happen.

What is the design intent for handling excess-precision floating-point computations in C++?

See CWG2752 for details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C++26Targeted at C++26ISShip vehicle: ISSG6Numericssize - smallpaper size estimate

    Type

    No type

    Projects

    Status

    reviewed, needs to come back

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions