Always false float comparisons

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Wed May 18 05:39:21 PDT 2016


Am Wed, 18 May 2016 11:48:49 +0000
schrieb deadalnix <deadalnix at gmail.com>:

> On Wednesday, 18 May 2016 at 11:11:08 UTC, Walter Bright wrote:
> > On 5/18/2016 3:15 AM, deadalnix wrote:  
> >> On Wednesday, 18 May 2016 at 08:21:18 UTC, Walter Bright wrote:  
> >>> Trying to make D behave exactly like various C++ compilers 
> >>> do, with all their
> >>> semi-documented behavior and semi-documented switches that 
> >>> affect constant
> >>> folding behavior, is a hopeless task.
> >>>
> >>> I doubt various C++ compilers are this compatible, even if 
> >>> they follow the
> >>> same ABI.
> >>>  
> >>
> >> They aren't. For instance, GCC use arbitrary precision FB, and 
> >> LLVM uses 128
> >> bits soft floats in their innards.  
> >
> > Looks like LLVM had the same idea as myself.
> >
> > Anyhow, this pretty much destroys the idea that I have proposed 
> > some sort of cowboy FP that's going to wreck FP programs.
> >
> > (What is arbitrary precision FB?)  
> 
> Typo: arbitrary precision FP. Meaning some soft float that grows 
> as big as necessary to not lose precision à la BitInt but for 
> floats.
> 

Do you have a link explaining GCC actually uses such a soft float? For
example
https://github.com/gcc-mirror/gcc/blob/master/gcc/fold-const.c#L20
still says "This file should be rewritten to use an arbitrary
precision..."



More information about the Digitalmars-d mailing list