Date: Fri, 2 Nov 2007 23:08:34 GMT From: Miguel Lopes Santos Ramos <miguel@anjos.strangled.net> To: petefrench@ticketswitch.com, stable@freebsd.org Subject: Re: Float problen running i386 inary on amd64 Message-ID: <200711022308.lA2N8YRT042912@satan.anjos.strangled.net> In-Reply-To: <E1Io4dE-0001eQ-8X@dilbert.ticketswitch.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> From: Pete French <petefrench@ticketswitch.com>
>
> Hi, I have a very simple program:
>
>
> int
> main(int argc, char *argv[])
> {
> if(atof("3.2") == atof("3.200"))
> puts("They are equal");
> else
> puts("They are NOT equal!");
> return 0;
> }
>
>
> This works as expected on both i386 and amd64. But if I take the compiled
> binary from the i386 system and run it on the amd64 system thenit says they
> are not equal! I thought this was a library problem, but it even happens if
> I compile to a static binary, which would preseumably mean the same code is
> running on both systems.
>
> I am using 6.3-PRERELEASE here
Unfortunately, I didn't have the luck of having it reproduced here.
Maybe because my i386 is on 7.0, different compiler (although the amd64 is
still on RELENG_6).
Since you've rulled out everything else by building a static binary,
did you try using the new C99 functions in fenv.h related to the
floating-point environment?
Miguel Ramos
Lisboa, Portugal
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711022308.lA2N8YRT042912>
