For the rest of this post, we are dealing with the representation of the binary digits from the perspective of the language, not the architecture.
By casting the resulting 32 bits to a 16 bit signed integer we take the first 16 bits, which are the bits we want, and we have a signed 16 bit sample that ranges from -32,768 to 32,767. Beautiful explanation of the 8.24 bit format, and a super clear explanation of the conversion process!
When you are thinking about bits, and bit shifting operations, think left to right in terms of significance. We assume these bits contain extra precision that we just dont need or are not interested in. We are only interested in the first 16 bits of data (the right most bits) that now contain the most significant bits of the 24 bit sample data. A brilliant side effect is that the first (left-most) bit of the first 16 bits represent the sign!
We want to preserve the sign, but chuck away 8 bits of the sample data to give us a signed 16 bit integer sample.
Best option trade brokers|
Best apps for options traders
Binary options trading signals free