[LUAU] unfixable x86 floating point damage

Jim Thompson jim at netgate.com
Wed Jul 27 22:47:02 PDT 2005


http://www.artima.com/forums/flat.jsp?forum=121&thread=120987

Its even EZ to test with gcc.   'gonzo' is a Powerbook (10.4.2) .   
'gentoo' is a P3 box (linux):

gonzo:~ jim$ cat tt.c
#include <math.h>
#include <stdio.h>

int
main(int argc, char** argv)
{
    double d = M_PI;
    printf("sin(PI) is %.16le\n", sin(d));
    d = M_PI_4;
    printf("sin(PI/4) is %.16le\n", sin(d));
}

gonzo:~ jim$ gcc tt.c
gonzo:~ jim$ ./a.out
sin(PI) is 1.2246467991473532e-16
sin(PI/4) is 7.0710678118654757e-01
gonzo:~ jim$ scp tt.c gentoo.netgate.com:
tt.c                                          100%  196     0.2KB/s    
00:00
gonzo:~ jim$ ssh gentoo.netgate.com
Last login: Tue Jul 26 17:24:51 2005 from  
ip68-108-69-127.lv.lv.cox.net  <--- its Vegas, baby!
/usr/jim> gcc tt.c -lm
/usr/jim> ./a.out
sin(PI) is 1.2246063538223773e-16
sin(PI/4) is 7.0710678118654746e-01





More information about the LUAU mailing list