Tool/software: Code Composer Studio
I want to multiply two numbers, in some cases it doesn't work correct.
In this case it works good :
_iq a=_IQ(10.0);
float32 b=2.5;
x = _IQtoF(_IQmpy(_IQ(b), a)); // result in float 25
But in this case it doesn't work correct
float32 q=0.0; _iq
y1=_IQ(1.5);
q =_IQtoF(_IQmpy(_IQ(100),y1)); // The result shoud be 150 but in viewwatch is it -1026293761
I tried to vary the IQ for example _IQ20(100), _IQ21(100) ..... but I don't get the right result.
What needs to be changed in the code
Thank you for the answer