Previous Up Next

7.1.8  Integer Euclidean quotient

The quotient and remainder of ordinary integers a and b are respectively integers q and r, where a=b q+r and 0 ≤ r < b.

The quotient and remainder of Gaussian integers a and b are respectively Gaussian integers q and r where r=ab q is as small as possible. It can be proven that r can be found so that |r|2 ≤ |b|2/2.

The iquo or intDiv command finds the integer quotient of two integers.

The div operator is the infixed version of iquo.

Examples

iquo(148,5)
     
29           
iquo(factorial(148),factorial(145)+2)
     
3176375           
iquo(25+12*i,5+7*i)
     
3−2 i           

Here r=ab q=−4+i and |−4+i|2=17<|5+7 i|2/2=74/2=37.

148 div 5
     
29           

Previous Up Next