From: Brian Ford Date: 2011-11-29T11:09:09+09:00 Subject: [ruby-core:41384] [ruby-trunk - Bug #5490] Bignum#div(0.0) raises FloatDomainError instead of ZeroDivisionError Issue #5490 has been updated by Brian Ford. Is this going to be backported to 1.9? The RubySpecs were changed with a ruby_version_is guard, which would be incorrect if this is considered a bug. If it's not considered a bug, why not? Thanks, Brian ---------------------------------------- Bug #5490: Bignum#div(0.0) raises FloatDomainError instead of ZeroDivisionError http://redmine.ruby-lang.org/issues/5490 Author: Brian Ford Status: Closed Priority: Normal Assignee: Category: Target version: ruby -v: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0] Bignum#div(0.0) raises FloatDomainError. Everything else raises ZeroDivisionError. This should be fixed in both 1.9.3 and 2.0.0. sasha:rubinius brian$ ruby -v ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0] sasha:rubinius brian$ irb ruby-1.9.2-p290 :001 > 1.div 0.0 ZeroDivisionError: divided by 0 from (irb):1:in `div' from (irb):1 from /Users/brian/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `
' ruby-1.9.2-p290 :002 > 1.1.div 0.0 ZeroDivisionError: divided by 0 from (irb):2:in `div' from (irb):2 from /Users/brian/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `
' ruby-1.9.2-p290 :003 > Rational(1).div 0.0 ZeroDivisionError: divided by 0 from (irb):3:in `div' from (irb):3 from /Users/brian/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `
' ruby-1.9.2-p290 :004 > 0xffff_ffff_ffff_ffff.div 0.0 FloatDomainError: Infinity from (irb):4:in `div' from (irb):4 from /Users/brian/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `
' Thanks, Brian -- http://redmine.ruby-lang.org