ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/05/27/15:39:44

Date: Wed, 27 May 1992 15:18:31 -0400 (EDT)
From: EINSTEIN AT PL9000 DOT PLH DOT AF DOT MIL (DAVE EINSTEIN)
Subject: floating point bug
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Status: O

	The following program produces erroneous output in djgpp

#include <stdio.h>

main()
{
	unsigned long int ul;
	double d;

	ul = 4200000000;
	d = ul;
	printf("%f %lu\n",d,ul);
}

Output is 
-94967296.0000000 4200000000

	The problem is that gcc is generating a floating point 
instruction that gas 1.38 doesnt recognize. (The same bug was found
and fixed by H. J. Lu in the linux compiler).  You probably know
about this D.J. (and it should be fixed in gcc2.2 ), however the
long long extension is fubar, and floating point should be eyed 
with suspicion.

	thanks,
		Deinst. 

P.S. Sorry about sending my last message to djgpp-request, it was
an accident (honest).


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019