Issue #5490 has been reported by Brian Ford.

----------------------------------------
Bug #5490: Bignum#div(0.0) raises FloatDomainError instead of ZeroDivisionError
http://redmine.ruby-lang.org/issues/5490

Author: Brian Ford
Status: Open
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 `<main>'
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 `<main>'
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 `<main>'
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 `<main>'

Thanks,
Brian



-- 
http://redmine.ruby-lang.org