Always false float comparisons

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Wed May 18 00:26:45 PDT 2016


On Tuesday, 17 May 2016 at 20:50:06 UTC, Walter Bright wrote:
> On 5/16/2016 7:47 AM, Max Samukha wrote:
>> On Monday, 16 May 2016 at 14:21:34 UTC, Ola Fosheim Grøstad 
>> wrote:
>>
>>> C++17 is getting hex literals for floating point for a 
>>> reason: accurate bit
>>> level representation.
>>
>> D has had hex FP literals for ages.
>
>
> Since the first version, if I recall correctly. Of course, C++ 
> had the idea first!
>
> (Actually, the idea came from the NCEG (Numerical C Extensions 
> Group) work in the early 90's, which was largely abandoned. C++ 
> has been very slow to adapt to the needs of numerics 
> programmers.)

The argument is not that C++ did anything first. The argument is 
that bit level precision for float is becoming the norm. Both in 
standards, languages and hardware. And that this makes it easier 
to write faster and more accurate code.

Please note that I don't complain about D providing 80 bit 
floats. Just don't apply it when I request 32 bit floats.

Some file formats have fields that are in the 80 bit intel 
format, so having access to it is a good thing.



More information about the Digitalmars-d mailing list