rails/rails — pull request #8236 by marcandre (2012-11-16 08:39:01+00:00)
Title: Use div

Avoid using `Integer#/`, as it is redefined by the 'mathn' stdlib to return rationals.

Otherwise the methods gives a strange result.

Note that `Integer#div` is more clear in its intent anyways.

I didn't use Integer#divmod because it is less efficient than a separate `div` and `%` (because of the intermediate array :-( )

I couldn't resist simplifying slightly the method (and making it slightly faster too).

Fixes #7087