Added range check in integer#round method #1918

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

Added check if integer#round method parameter isn't too big to be converted to int.

Owner

brixen commented Sep 22, 2012

MRI has numerous areas where it uses values that exceed a Fixnum but fit into a machine integer. In general, these are implementation details of MRI.

In cases like the index of a String or Array, Rubinius already simply requires a Fixnum. In this case, the exception doesn't alter Integer#round behavior for any value that is valid on MRI. The spec should be change to deviates_on :rubinius.

The tag deletion for "Integer#round returns 0 if passed a big negative value" has nothing to do with the change in this commit.

@brixen brixen closed this Sep 22, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment