Movement against float.init being nan

Ali Çehreli acehreli at yahoo.com
Tue Aug 23 21:53:35 UTC 2022


On 8/23/22 14:40, Dave P. wrote:

 >> And yes, 0 happens to be a valid garbage value.
 >
 > The default value for a struct imported via importC is all bits 0.

Steve said the same thing but I don't see it on the ImportC page (yet?):

   https://dlang.org/spec/importc.html

I wonder why D would do that.

 > This is not a “garbage value”.

D could set all bits to any other value and it would still be fine 
because either C's initialization function would be called on the object 
(some programmers call memset), or the programmer did not care.

Ali



More information about the Digitalmars-d mailing list