public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* FLT_EVAL_METHOD vs fexcess-precision
@ 2023-09-01  9:55 Mathieu Malaterre
  2023-09-01 10:14 ` Jonathan Wakely
  2023-09-01 10:28 ` Jonathan Wakely
  0 siblings, 2 replies; 6+ messages in thread
From: Mathieu Malaterre @ 2023-09-01  9:55 UTC (permalink / raw)
  To: gcc-help

Hi all,

I am reading a previous post from Pascal Cuoq(*), and it seems things
have changed quite a bit in GCC nowadays. I fail to understand how
FLT_EVAL_METHOD relates to fexcess-precision. Did I miss something?

---

Here is what I see on my Debian/sid/i386 system:

 % gcc -O2 -fexcess-precision=fast   m.c && ./a.out
float eps = 1.192093e-07
2

while:

 % gcc -O2 -fexcess-precision=standard   m.c && ./a.out
float eps = 1.084202e-19
2

with:

 % cat m.c
#include <stdio.h>
#include <float.h>

int main(void)
{
    float floatEps = 1;

    while (1 + floatEps / 2 != 1)
        floatEps /= 2;

    printf("float eps = %e\n", floatEps);
    printf("%d\n", FLT_EVAL_METHOD);
}

For reference:

 % gcc --version
gcc (Debian 13.2.0-2) 13.2.0

(*) https://stackoverflow.com/a/16064515/136285
-- 
Mathieu

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

end of thread, other threads:[~2023-09-01 12:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-01  9:55 FLT_EVAL_METHOD vs fexcess-precision Mathieu Malaterre
2023-09-01 10:14 ` Jonathan Wakely
2023-09-01 10:19   ` Jonathan Wakely
2023-09-01 10:28 ` Jonathan Wakely
2023-09-01 12:02   ` Mathieu Malaterre
2023-09-01 12:19     ` Jonathan Wakely

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).