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.
Dear all
I have questions about the function “_IQdiv " of IQmath Library.
- What happens if I divide with" 0 "?
- How is an overflow absorbed?
Thanks
Wei
Wei,
The IQdiv function will return max value (0x7FFF FFFF) when you divide by zero (basically saturate +ve value).
Also, any division overflow will always saturate.
Cheers,
Alex T.
Wei,
For _IQdiv:
;; On Exit: ACC = Num/Den result in IQ format
;; = 0x7FFFFFFF if +ve overflow
;; = 0x80000000 if -ve overflow
;; = 0x7FFFFFFF if Den == 0
This behavior should be documented in the IQmath user's guide, but I see that it is not.
Regards,
David
Thanks for all of your reply.
We may need to put such info into user's guide.
Cheers,
Wei
A denominator of zero always returns max +ve value, irrespective of the numerator value.
So _IQdiv(0, 0) returns max +ve value (0x7FFFFFFF).
Cheers,
Alex T.
What about _IQdiv(-0,0) or _IQdiv(-1,0)? Would those still return the max positive value? Is this documented anywhere?