Movement against float.init being nan

Dom Disc dominikus at scherkl.de
Mon Aug 22 08:40:09 UTC 2022


On Sunday, 21 August 2022 at 19:57:52 UTC, apz28 wrote:
> Price for this float=NaN & char=FF
> 1. Runtime bloat -> all struct/class with (float or char) need 
> special initializer
No. If intentional you can explicitly leave them uninitialized (= 
void)

> 2. Slow -> all struct/class not able to utilize zero 
> initialized from memory manager
Fill with specific pattern is _really_ fast, so very very low 
performance lost - and only once as you shouldn't do 
initialization in a loop, do you?

> 3. Inconsistent with other value types (all zero bits)
I agree to this, but you choose the wrong solution.
Correct would be to initialize the remaining types also with an 
invalid value instead of zero.

> 4. Aggregated/Sum float var should start with zero
Why? For this to be an argument on its own, it should not refer 
to (1)..(3)

So: no argument left. Too bad.


More information about the Digitalmars-d mailing list