previous | index | next

Integer Operations

Recall that Racket's (quotient n d) gives the number of times d divides n, where both are integers.

In C++, the integer operator "/" does the same thing:

Racket C++ Value
(quotient 9 3) 9/3 3
(quotient 10 3) 10/3 3
(quotient 11 3) 11/3 3
(quotient 12 3) 12/3 4

Recall that "/" in Racket produces a rational number.

C++ does not have rationals.


previous | index | next