lkml.org 
[lkml]   [2002]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: FPU, i386
Andrey Ulanov writes:
> Look at this:
>
> $ cat test.c
> #include <stdio.h>
>
> main()
> {
> double h = 0.2;
>
> if(1/h == 5.0)
> printf("1/h == 5.0\n");
>
> if(1/h < 5.0)
> printf("1/h < 5.0\n");
> return 0;
> }
> $ gcc test.c

$ gcc -O test.c
$ ./a.out
1/h == 5.0

without -O, gcc initializes h to 0.2000000000000000111

> $ ./a.out
> 1/h < 5.0
> $
>
> I also ran same a.out under FreeBSD. It says "1/h == 5.0".
> It seems there is difference somewhere in FPU
> initialization code. And I think it should be fixed.
>
> ps. cc to me
> --
> with best regards, Andrey Ulanov.
> drey@rt.mipt.ru
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.050 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site