public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/112367] New: wrong rounding of sum of floating-point constants
@ 2023-11-03 11:09 zimmerma+gcc at loria dot fr
  2023-11-03 11:11 ` [Bug c/112367] " sjames at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2023-11-03 11:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112367
           Summary: wrong rounding of sum of floating-point constants
           Product: gcc
           Version: 6.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zimmerma+gcc at loria dot fr
  Target Milestone: ---

The following code:

#include <stdio.h>
#include <fenv.h>

#pragma STDC FENV_ACCESS ON

int main()
{
  fesetround (FE_UPWARD);
  float x = 0x1.e90026p+4f + 0x1.fp-21;
  printf ("x=%a\n", x);
}

yields on cfarm117 with gcc 6.3.0:

zimmerma@cfarm117:~/core-math$ gcc -frounding-math e.c -lm; ./a.out
x=0x1.e90026p+4

whereas one would expect 0x1.e90028p+4.

I don't have access to an ARM machine with a recent version of gcc.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-11-06  8:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-03 11:09 [Bug c/112367] New: wrong rounding of sum of floating-point constants zimmerma+gcc at loria dot fr
2023-11-03 11:11 ` [Bug c/112367] " sjames at gcc dot gnu.org
2023-11-03 11:15 ` zimmerma+gcc at loria dot fr
2023-11-03 11:21 ` sjames at gcc dot gnu.org
2023-11-03 11:21 ` sjames at gcc dot gnu.org
2023-11-03 11:40 ` amonakov at gcc dot gnu.org
2023-11-04  5:48 ` [Bug middle-end/112367] " pinskia at gcc dot gnu.org
2023-11-06  8:59 ` [Bug middle-end/112367] wrong rounding of sum of floating-point constants with -frounding-math zimmerma+gcc at loria dot fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).