Previous Up Next

6.5.8  The integer Euclidean quotient: iquo intDiv div

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 command finds the integer quotient of two integers.
intDiv is a synonym for iquo.


Examples.


The div operator is the infixed version of iquo.


Example.
Input:

148 div 5

Output:

29

Previous Up Next