https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125127

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
In C++ it is https://eel.is/c++draft/expr#pre-6
Note, like in C, -fexcess-precision=standard does the conversions on explicit
casts and assignments, but otherwise for FLT_EVAL_METHOD 2 constants and
arithmetics are evaluated to the precision of long double.
So, (int)(double)(a / b) is evaluated as if (int)(double)((long double)a /
(long double)b), while (int)(a / b) is evaluated as if (int)((long double)a /
(long double)b).
If you do double c = 4.1 + 0.1; it is evaluated as if (double)(4.1L + 0.1L).
This doesn't affect the types of the expressions, those are still the ones
you'd expect.
See also PR107097.

Reply via email to