tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Kosmas Papachristos <papahr () ics ! forth ! gr>
To: tru64-unix-managers
Subject: Floating Point Error?
Date: Tue, 01 Aug 1995 15:05:59 +0000	[thread overview]
Message-ID: <96075322406392.tru64-unix-managers.marc@archive.invalid> (raw)


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

                 reply	other threads:[~1995-08-01 15:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

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