Previous Up Next

5.6.10  The integer Euclidean quotient: iquo intDiv div

iquo (or intDiv) returns the integer quotient q of the Euclidean division of two integers a and b given as arguments. (a=b*q+r with 0≤ r< b).
For Gaussian integers, we choose q so that b*q is as near by a as possible and it can be proved that r may be chosen so that |r|2 ≤ |b|2/2.
Input:

iquo(148,5)

Output:

29

iquo works with integers or with Gaussian integers.
Input:

iquo(factorial(148),factorial(145)+2 )

Output:

3176375

Input:

iquo(25+12*i,5+7*i)

Output:

3-2*i

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

The infixed version of this command is div.
Input:

148 div 5

Output:

29

Previous Up Next