I found this code on StructToIEEE754. The lines [ unsigned int mantissa:23; ] as a part (:23) that I didn’t learn about until now. Though, obviously the meaning must most probably mean that the length of mantissa is determined to be 23 bits, I have no clue as to how one can cram exactly 23 bits into a type int.
union flt {
struct ieee754 {
unsigned int mantissa:23 ;
unsigned int exponent:8 ;
unsigned int sign:1 ; } raw ; // 23 + 8 + 1 = 32 bits
float f; } // 32 bits
https://www.cplusplus.com makes no reference to it , nor anywhere else I could find on the web.
Can please someone point to me where I can read intricate details about this newly acquired programming trick ?
Is type identifier : odd_size ; when utilized in a union definition, a defined behavior ?