CWG2752 Excess-precision floating-point literals #1584
Labels
C++26
Targeted at C++26
IS
Ship vehicle: IS
paper needed
An issue needs a paper to describe its solution
SG6
Numerics
size - small
paper size estimate
Projects
In C23, floating-point literals (called "constants" there) can be represented with excess precision, meaning a
float
literal is treated as adouble
orlong 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 withfloat
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.
The text was updated successfully, but these errors were encountered: