Movement against float.init being nan

Walter Bright newshound2 at digitalmars.com
Wed Aug 24 05:14:34 UTC 2022


On 8/23/2022 5:00 PM, Steven Schveighoffer wrote:
> On one hand, it's a C struct. But on the other hand, it's a D function. Who's 
> rules are used?

The C rules. This is because D is importing C code, so it better behave like C 
code. C code does initialize floats and doubles to 0.0 if they are placed in 
static data. It is not reasonable that D would leave imported C structures 
uninitialized when C does, and so initializing them to 0.0 is a reasonable choice.



More information about the Digitalmars-d mailing list