This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP-IQMATHLIB: About IQ number division



I'm currently using IQMathLib in my project. And I encountered a problem with _IQ29div.

The dividend was 0.0027313 and the divisor was 0.0101318, but the output was 0.1347891.

And  I tested another set of number, 0.0148468 as dividend , 0.0569763 as divisor, and the output was 0.1302892.

The outputs were wrong, and both of them were about the half of correct answer.

Is there any known issue with _IQ29div?

  • Hello,

    What MSP device are you using? What's the IQ format for the numerator and the denominator? Are they both IQ29?

    If the value is half (1/2) of what's expected, then it seems like the the result is getting shifted to the right by 1 bit somehow (e.g. 10000b (16d) rsh 1 = 1000b (8d)). I'm not sure if this is an issue with the library or if there's saturation going on.

    Does this happen for IQ28div or IQ30div?