Remainders
- Racket has a built-in procedure called quotient that works just
like our quot.
- Sometimes it is useful to have the remainder
that results from dividing an integer into
another using quotient.
- For example, the remainder when dividing 10
by 3 is 1.
- Racket has a remainder procedure of the
form (remainder n d)
Expression | Value
|
(remainder 10 3) | 1
|
(remainder 317 60) | 17
|
(remainder -351832 31) | -13
|
- Q: How to write remainder using quotient?