From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96075322406392.tru64-unix-managers.marc@archive.invalid> From: Kosmas Papachristos Date: Tue, 01 Aug 1995 15:05:59 +0000 To: tru64-unix-managers Subject: Floating Point Error? X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96075322406392 Hello managers, Has anyone else noticed the following strange behavior? Run the following program: #include 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