Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JRuby 1.6.6, JRuby 1.7.0.pre1
-
Component/s: Intro
-
Labels:None
-
Environment:--1.9
-
Number of attachments :
Description
jruby --1.9 -e '42.round(-2**30)'
This will cheerfully consume a thread's worth of cpu more or less indefinitely. Impatient users will need kill -9 to recover.
mri 1.9.2 returns 0.0 without any difficulty.
This is because MRI has short circuit logic to return 0 if the argument is small enough.
https://github.com/ruby/ruby/blob/0a5ac6a44809ec32ae6e836086708a64112bcfd0/numeric.c#L1469-1472
This should be pretty easy to fix.