[OT] The Usual Arithmetic Confusions

Timon Gehr timon.gehr at gmx.ch
Sun Feb 6 03:26:31 UTC 2022


On 06.02.22 00:04, Walter Bright wrote:
> ...
>>
>> My current understanding is that this can change at any point in time 
>> without it being considered a breaking change, and that DMD is more 
>> likely to do this than LDC.
> 
> Highly unlikely.

Great!

> (Neither the C nor the C++ standards require this 
> behavior, either, AFAIK, so you shouldn't use any other compilers, either.)

In practice, the story is a bit more complicated than this. Besides the 
C and C++ standards, there is also IEEE 754 and common practice, in 
particular 32/64 bit IEEE 754. Compilers implement multiple standards, 
at least with a suitable set of flags, and they explicitly document the 
guarantees one can expect with each set of flags.



More information about the Digitalmars-d mailing list