What are the purposes of fixed-point? When should it be used?
I read:
#define Int2Fixed(x) (((long)(short) x) << 16)
and the fixed-point in 16.16 format. Does the 16 in the MACRO refer to
integer or decimal part? For example, if in 8.24, should the macro be:
#define Int2Fixed(x) (((long)(short) x) << 24)?
Another question is about the casting here. What is actually happening when
doing casting like : (long)(short)x? Could someone elaborate this?
Grateful to your help!
I read:
#define Int2Fixed(x) (((long)(short) x) << 16)
and the fixed-point in 16.16 format. Does the 16 in the MACRO refer to
integer or decimal part? For example, if in 8.24, should the macro be:
#define Int2Fixed(x) (((long)(short) x) << 24)?
Another question is about the casting here. What is actually happening when
doing casting like : (long)(short)x? Could someone elaborate this?
Grateful to your help!
Comment