This project is archived and is in readonly mode.

#2982 ✓committed
Xavier Noria

[PATCH] Let Integer#multiple_of? accept zero as argument

Reported by Xavier Noria | August 1st, 2009 @ 02:45 AM

Currently Integer#multiple_of? delegates to %, and so raises a division by zero exception if the argument is zero.

But that case is of course well-defined: no integer is multiple of zero except zero. This little patch adds that.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages