Date: Mon, 6 Nov 1995 10:34:37 -0600 (CST) From: Joe Diehl <joed@engg.ksu.edu> To: Jerry.Kendall@vmicls.com, hackers@freebsd.org Subject: Re: Pentium BUG Message-ID: <199511061634.KAA23017@bilbo.me.ksu.edu> In-Reply-To: <9511061410.AA16785.gonzo@vmicls.com> from "Jerry Kendall" at Nov 6, 95 09:10:22 am
next in thread | previous in thread | raw e-mail | index | archive | help
As Jerry Kendall wrote: > > A while ago, I read somewhere, a little test procedure that I could do > to test and see if my Pentium had this 'well-known' bug. > > Does anyone know what this procedure is ??? > > Jerry > Here's a small little program to test for the bug: #include <stdio.h> int main() { double x,y,z; x = 4195835.0; y = 3145727.0; z = x - (x / y) * y; printf("%f\n",z); return 0; } As you can see, by simply algebra, z should always == 0; however, on a Pentium with the FDIV bug, you can get odd answers with certain numbers. In this case, the answer will be 256 if you have the bug, and 0 if you don't... Here is the sig of the guy who either wrote the code or posted the code without any credit given to the author... ___ |0 0| Thanks, | ^ | Duck (\_/) Wm. David "Duck" McDonald, Anderson SC USA ,______| | and.factm.tr@ocf.compuserve.com \______/ TOP-DUCK@genie.geis.com Enjoy... :-) --- Joe Diehl <joed@engg.ksu.edu> Engineering Computing Center Kansas State University
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511061634.KAA23017>