www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/31/01:39:47

Date: Wed, 31 Jan 1996 08:25:20 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Russell Blackadar <russell AT news DOT mdli DOT com>
Cc: djgpp AT delorie DOT com
Subject: Re: float != float and floats as return types

On 30 Jan 1996, Russell Blackadar wrote:

> say (and I think he'd agree) it doesn't wash.  I ran his posted code and
> got all zeroes.  Either there's a *serious* problem with his compiler, or the
> posted code is not the same as what he compiled.  Either way, he should try

The only way I can explain your all-zeroes result is if you compile that
source with no optimizations (and even then I'm not sure you could ever
get all zeroes with Gcc).  Otherwise, storing a 80-bit internal x87
representation of a floating-point number into a 32-bit float will
*always* result in a relative error of about 1e-7. 

The original poster said explicitly that the problem only pops up when
optimizations are turned on, as far as I remember.

- Raw text -


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