Actions
Bug #1712
closedComplex#% Raises NoMethodError for #floor
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-07-01 trunk 23924) [i686-linux]
Backport:
Description
=begin
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 `<main>'
=end
Actions
Like0
Like0Like0