From: Alex Young Date: 2011-03-18T22:24:57+09:00 Subject: [ruby-core:35526] [Ruby 1.9 - Bug #4510][Open] Float#round(n) is O(n) Issue #4510 has been reported by Alex Young. ---------------------------------------- Bug #4510: Float#round(n) is O(n) http://redmine.ruby-lang.org/issues/4510 Author: Alex Young Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux] The current implementation of Float#round(n) is O(n). This causes a minor issue with rubyspec, which includes this: 0.8346268.round(-2.0**30).should == 0 which would take about 5 minutes to complete on my machine, during which time the interpreter is locked, doesn't respond to signals, and certainly won't brook any Timeout interruption. Attached is a patch to replace the problematic part with a call to pow(3). -- http://redmine.ruby-lang.org