up previous next
div    --    quotient for integers


Syntax
div(N: INT, D: INT): INT

Description
This function computes the integer quotient of N divided by D; it is equal to N/Drounded towards zero. The companion function mod computes the corresponding remainder.

If we set Q = div(N,D) and R = mod(N,D) then N = Q*D + R.

NOTE: for polynomials use NR (remainder), DivAlg (quotients and remainder), IsIn (ideal membership).

Example
/**/ div(10,3);
3
/**/ div(10,-3);
-3

See Also