Part Number: MSP430FR5992
Dear all,
i have a problem using the fixed point math. Maybe its a problem in understanding but i think its more a problem in the implementation - hopefully no hardware problem.
I want to multiply two numbers in the _iq15 format and have stumbled over the following obvious error:
_IQ15(-0.0015) = a = -49
_IQ15(0.0015) = b = 49
so far so good... but multiplying both values result in:
_IQ15rsmpy(a,b) = c = -2,147484E+09
_IQ15toF(c) = -65536.0 ... but it should be 0.00000225 which should be rounded to 0
If I use _IQ15rmpy(a,b), than it returns the right value “0”.
*edit* As the edited title says i narrowed it down: it seems to only happen if only one values is negative and if the result should be rounded to 0 all other cases I tried it works as expected.
What am I overlooking or understanding wrong? I would really appreciate if someone could point me in the right direction.
Best wishes
Tobias