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.

Q 格式的问题



  请教个问题:  在做除法的时候,我使用Q格式  如做一个 2/3   , GLOBAL_Q  28。
_iq in1,out1;
_iq28 in2,out2;
int main(void)
{
in1=_IQ(1.5);
out1=_IQdiv(_IQ(1.0),in1);
in2=_IQ28(1.5);
out2=_IQ28div(_IQ28(1.0),in2);
}
计算的结果为:
     
计算结果out1 、out2怎么变成-1  也就是FFFFFFFF   溢出了??
下面是TI官网的关于_IQdiv()的用法
附件是调试程序。不知什么原因做除法得到的结果就为-1,;加法和乘法正常。本人试过4/2    2/4 结果均为-1.
不解。
IQ.zip