Because a float contains bit fields including sign of the exponent, sign, mantissa, sign of the mantissa. It's a bit of a pedantic argument but technically it makes sense.
You could call them composite in that sense, but in C, composite types are types that are composed of other C types (structs, unions, arrays, ... functions? Not 100% sure of the specifics).
Also, the representations of floats and doubles isn't precisely specified, at least IEEE754 is not a strict requirement (not sure about the technical implications from what's actually specified).
I'm not really sure I get why the distinction between composite and non-composite types is important if the only difference is that you can't easily access sub-parts of the non-composite types.
Because a float contains bit fields including sign of the exponent, sign, mantissa, sign of the mantissa. It's a bit of a pedantic argument but technically it makes sense.
You could call them composite in that sense, but in C, composite types are types that are composed of other C types (structs, unions, arrays, ... functions? Not 100% sure of the specifics).
Also, the representations of floats and doubles isn't precisely specified, at least IEEE754 is not a strict requirement (not sure about the technical implications from what's actually specified).
I'm not really sure I get why the distinction between composite and non-composite types is important if the only difference is that you can't easily access sub-parts of the non-composite types.
3 replies →
I'm not the one making the argument, merely explaining why the GGP may have chosen this example.
1 reply →