Why LDC drop d_with_sum code? (windows)

KnightMare black80 at bk.ru
Tue May 28 13:30:11 UTC 2019


>> DMD & LDC change d_with_sum(...) to "return .0"
>> why?
>
> Because you are summing an empty array.
> `squares` is initialized with length and pointer 0, and the 
> values[] * values[] gets truncated to the size of the 
> destination memory, so it becomes a no-op.

yep. thx.
C:\content\downloadz\dlang>times2.exe
t1=42 ms, 929 ╬╝s, and 1 hnsec          r=109226661546_74544967680
t2=42 ms and 578 ╬╝s                    r=109226661546_74544967680
t3=333 ms, 539 ╬╝s, and 3 hnsecs        r=109226661546_66672259072
t4=42 ms, 631 ╬╝s, and 9 hnsecs         r=109226661546_74544967680

now I have not small diff but probably double math..


More information about the digitalmars-d-ldc mailing list