From owner-freebsd-hackers Mon Nov 6 08:37:12 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id IAA01136 for hackers-outgoing; Mon, 6 Nov 1995 08:37:12 -0800 Received: from gandalf.me.ksu.edu (root@gandalf.me.ksu.edu [129.130.41.86]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id IAA01129 for ; Mon, 6 Nov 1995 08:37:05 -0800 Received: from bilbo.me.ksu.edu (joed@bilbo.me.ksu.edu [129.130.41.87]) by gandalf.me.ksu.edu (8.6.10/8.6.9) with ESMTP id KAA05694; Mon, 6 Nov 1995 10:36:50 -0600 Received: (from joed@localhost) by bilbo.me.ksu.edu (8.6.9/8.6.9) id KAA23017; Mon, 6 Nov 1995 10:34:37 -0600 From: Joe Diehl Message-Id: <199511061634.KAA23017@bilbo.me.ksu.edu> Subject: Re: Pentium BUG To: Jerry.Kendall@vmicls.com, hackers@freebsd.org Date: Mon, 6 Nov 1995 10:34:37 -0600 (CST) In-Reply-To: <9511061410.AA16785.gonzo@vmicls.com> from "Jerry Kendall" at Nov 6, 95 09:10:22 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1144 Sender: owner-hackers@freebsd.org Precedence: bulk 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 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 Engineering Computing Center Kansas State University