Bug of the sqrt() compiled by DMD

Salih Dincer salihdb at hotmail.com
Mon Jun 20 13:36:45 UTC 2022


On Sunday, 19 June 2022 at 22:19:18 UTC, kdevel wrote:
> On Sunday, 19 June 2022 at 20:26:27 UTC, Salih Dincer wrote:
>> Because the size of the number is only twice uint.max.
>
> The mantissa of double has only 53 bits which is less than 
> twice the number of bits in an (u)int. 94906267 occupies 27 
> bits:
>
> ```
>                                |                          |
>            94906267 
> 0000000000000000000000000000000000000101101010000010011110011011
>    9007199515875289 
> 0000000000100000000000000000000000001111100100001001011111011001
> ```
>
>> When integer type is changed qua long, the problem is fixed.

Good job, thank you very much. However, I am still not completely 
convinced. I need to do some work on [God 
Bolt](https://godbolt.org).

SDB at 79


More information about the Digitalmars-d mailing list