* Floating Point Error?
@ 1995-08-01 15:05 Kosmas Papachristos
0 siblings, 0 replies; only message in thread
From: Kosmas Papachristos @ 1995-08-01 15:05 UTC (permalink / raw)
To: tru64-unix-managers
Hello managers,
Has anyone else noticed the following strange behavior?
Run the following program:
#include <stdio.h>
void main()
{
float fnum,dec;
fnum = 0.18;
printf("FNUM = %f\n",fnum);
dec = fnum * 10000.0;
printf("DEC = %f\n",dec);
}
and you will get :
FNUM = 0.180000
DEC = 1800.000122
This same output is produced using both cc and gcc-2.7.0
The machine I run this code is a DEC 3000/600 with OSF1/v3.2
If instead of float, use double the problem disappears !
..I didn't notice any sign ``Pentium inside'' on the cover though..
Kosmas Papachristos
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1995-08-01 15:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-08-01 15:05 Floating Point Error? Kosmas Papachristos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox