public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* bug in float on Pentium
@ 2001-04-13 23:23 Joe
  2001-04-14  2:57 ` Alan Cox
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Joe @ 2001-04-13 23:23 UTC (permalink / raw)
  To: linux-kernel

Not sure but I think I found a NEW bug.

I know that there have been some issues with pentiums and floating point
arrithmatic, but this takes the cake...

Linux Lserver.org 2.2.18 #43 SMP Fri Mar 9 14:19:41 EST 2001 i586
unknown

>kgcc --version
egcs-2.91.66

RH 6.2.x / 7.0

try this program

#include <stdio.h>

int main() {

    char tmpx[100];
 char tmpy[100];

 double x = 5483.99;
 float y = 5483.99;

    sprintf (tmpx, "%f",x );
    sprintf (tmpy, "%f",y );

 printf ("%s\n%s\n", tmpx, tmpy);
 return 0;
}


I am getting the following as output

joeja@Lserver$ ./testf
5483.990000
5483.990234


what is with the .990234??  it should be .990000

any ideas on this??

--
Joe Acosta ........
home: joeja@mindspring.com




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-04-15  6:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-13 23:23 bug in float on Pentium Joe
2001-04-14  2:57 ` Alan Cox
2001-04-14  3:01 ` Jakob Østergaard
2001-04-14  5:35 ` Jonathan Morton
2001-04-15  6:02 ` Matt Billenstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox