Movement against float.init being nan

Steven Schveighoffer schveiguy at gmail.com
Tue Aug 23 01:19:35 UTC 2022


On 8/22/22 8:50 PM, Walter Bright wrote:
> On 8/20/2022 3:17 PM, Dukc wrote:
>> it goes against what C, C++ and C# (and probably many other languages) 
>> do so one is easily surprised.
> 
> C and C++ initialize them to garbage unless it is a global/static 
> variable. That's probably the worst option, as it results in Heisenbugs 
> that are very hard to track down.

Agreed that C/C++ initializing with garbage is the worst option.

C# (as also mentioned) uses 0.

I'm curious what all languages do that actually use an initial value?

-Steve


More information about the Digitalmars-d mailing list