[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] The killer heuristic
From: |
Arend Bayer |
Subject: |
Re: [gnugo-devel] The killer heuristic |
Date: |
Sun, 26 Jan 2003 03:04:23 +0100 (CET) |
Evan wrote:
> Floating point rounding problems is an interesting thought... is there a
> way to compile things to do IEEE floating point instead of platform
> dependent, to test this out?
Well gcc has an option -mieee-fp but I doubt this works.
Try the example program below. I consistently get "not equal" as result
(also with -mieee-fp). When compiling this with -O2, the executable
doesn't even contain the string "the same" anymore, as this branch gets
optimized away.
I don't know IEEE, so either this is IEEE-correct (which means that IEEE
doesn't do what one (at least me) would naively expect it to do), or
this should be considered a compiler bug.
Arend
#include <stdio.h>
#include <unistd.h>
int
main()
{
float x = 1.0;
float y = 1.0/3.0;
if (x / 3.0 == y)
fprintf(stdout, "the same\n");
else
fprintf(stdout, "not equal\n");
return 0;
}
- [gnugo-devel] The killer heuristic, Evan Berggren Daniel, 2003/01/24
- Re: [gnugo-devel] The killer heuristic, Arend Bayer, 2003/01/24
- Re: [gnugo-devel] The killer heuristic, bump, 2003/01/24
- Re: [gnugo-devel] The killer heuristic, Arend Bayer, 2003/01/25
- Re: [gnugo-devel] The killer heuristic, Evan Berggren Daniel, 2003/01/25
- Re: [gnugo-devel] The killer heuristic, Arend Bayer, 2003/01/25
- Re: [gnugo-devel] The killer heuristic, Evan Berggren Daniel, 2003/01/25
- Re: [gnugo-devel] The killer heuristic,
Arend Bayer <=
- Re: [gnugo-devel] The killer heuristic, Evan Berggren Daniel, 2003/01/25
- Re: [gnugo-devel] The killer heuristic, Evan Berggren Daniel, 2003/01/25
- Re: [gnugo-devel] The killer heuristic, Dave Denholm, 2003/01/26