One potential use case for this is to capture the mantissa bits, exponent bits, and the sign bit if that is interesting. For this you can use union:
union doubleBits { double d; long l; };
You can install your double and install it in a union:
union doubleBits myUnion; myUnion.d = myDouble;
And the bit shifts the long part of the union after extracting the bits like this:
myUnion.l >>= 1;
Since the number of bits for each part of the double is determined, this is one way to extract the representation of the base bit. This is one use case where you could get raw base bits. I am not familiar with Simulink, but if it is possible, why the double was replaced in the first place, this may be the way to achieve this behavior in C. The fact that it was always 12 bits makes me think differently, but just in case I thought that it is worth pointing to others who stumble on this question.
source share