Always false float comparisons

Max Samukha via Digitalmars-d digitalmars-d at puremagic.com
Tue May 17 11:09:34 PDT 2016


On Monday, 16 May 2016 at 19:01:19 UTC, Timon Gehr wrote:

>> You are not even guaranteed to get the same result on two 
>> different x86
>> implementations.
>
> Without reading the x86 specification, I think it is safe to 
> claim that you actually are guaranteed to get the same result.

Correct. Sorry for the noise.

>
>> AMD64:
>>
>> "The processor produces a floating-point result defined by the 
>> IEEE
>> standard to be infinitely precise.
>> This result may not be representable exactly in the 
>> destination format,
>> because only a subset of the
>> continuum of real numbers finds exact representation in any 
>> particular
>> floating-point format."
>>
>
> This just says that results of computations will need to be 
> rounded to fit into constant-size storage.

Right.



More information about the Digitalmars-d mailing list