Floating point values in structs.

Dave P. dave287091 at gmail.com
Tue Dec 22 18:43:02 UTC 2020


On Tuesday, 22 December 2020 at 18:10:22 UTC, Dukc wrote:
> On Friday, 18 December 2020 at 16:18:12 UTC, Dave P. wrote:
>> [...]

Honestly, I just want all bits zero. I don’t work with any 
platforms where null is not 0 and all-zero-bits aggregates can be 
efficiently represented in static storage. I don’t want the 
compiler inserting a ton of stores of nan to my float members. If 
I wanted something other than all bits zero for unmentioned 
members I would write constructors instead of using the struct 
initializer syntax. I generally design my data types such that 
all bits zero is a fully valid struct.

But it is what it is. I just have to remember to write `=0` 
whenever I have a float member or a char member.





More information about the Digitalmars-d-learn mailing list