Closed
Description
Discussing the validity invariant of integer and floating point types.
Clearly, every possible bit pattern is allowed. For integers they all have a distinct and meaningful interpretation, and we have a safe NOP-conversion between f32
and u32
, and f64
and u64
, through to_bits
and from_bits
.
The remaining open question is: is it ever allowed to have an uninitialized bit in an integer or floating point value? We could reasonably decide either way. Also, when an integer is partially uninitialized, does that "infect" the entire integer or do we exactly preserve which byte is initialized?
2022-09-07: This has now pretty much been answered.