[racket] (floor (/ ....))

From: Stephan Houben (stephanh42 at gmail.com)
Date: Tue Jun 11 04:23:49 EDT 2013

Oops. You are correct.

It appears there is no procedure that is to modulo as what
quotient is to remainder.
(floor (/ x y)) seems to be the only option if x and y may be negative.

Stephan


2013/6/11 Laurent <laurent.orseau at gmail.com>

>
> On Tue, Jun 11, 2013 at 9:45 AM, Stephan Houben <stephanh42 at gmail.com>wrote:
>
>>   replace (floor (/ a b)) with (modulo a b)
>>
>
>
> Actually:
> > (modulo 10 3)
> 1
> > (remainder 10 3)
> 1
> > (quotient 10 3)
> 3
> > (floor (/ 10 3))
> 3
>
> `modulo' is more like `remainder', except for negative numbers.
>
> Laurent
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130611/89b35b65/attachment.html>

Posted on the users mailing list.