From: Run Paint Run Run Date: 2009-07-02T07:06:32+09:00 Subject: [ruby-core:24110] [Bug #1712] Complex#% Raises NoMethodError for #floor Bug #1712: Complex#% Raises NoMethodError for #floor http://redmine.ruby-lang.org/issues/show/1712 Author: Run Paint Run Run Status: Open, Priority: Normal Category: core ruby -v: ruby 1.9.2dev (2009-07-01 trunk 23924) [i686-linux] 1.8's Complex had a modulus operator (%); 1.9's doesn't, and attempts to use it raise a NoMethodError for #floor because it falls back to Numeric#% which needs #floor. Is this omission intentional? If so, could an appropriate NoMethodError be raised instead? If not, I'd appreciate knowing so I can write the specifications. >> Complex(13, 44) % Complex(5, 20) NoMethodError: undefined method `floor' for ((189/85)-(8/85)*i):Complex from (irb):3:in `div' from (irb):3:in `%' from (irb):3 from /usr/local/bin/irb:12:in `
' ---------------------------------------- http://redmine.ruby-lang.org