From: Marc-Andre Lafortune Date: 2010-04-29T01:14:30+09:00 Subject: [ruby-core:29855] Re: Is Math module a wrapper of libm? Unless there is an objection, I will make Math::DomainError a direct descendant of StandardError (instead of ArgumentError), the same way that RangeError or IndexError are. I also think that ZeroDivisionError should be a descendant of Math::DomainError, but that is less important and should be confirmed. On Mon, Mar 8, 2010 at 11:58 PM, Marc-Andre Lafortune wrote: > Hi, > > On Tue, Mar 2, 2010 at 4:33 AM, "Martin J. D�rst" > wrote: >> What about Encoding::InvalidByteSequenceError and similar? > > Thanks for bringing these up, I was not aware of these. I'll add these > to the Exceptions that should be documented [redmine:2829] > > In view of this, I'm fine with Math::DomainError. > > Remaining questions: > 2) should it subclass ArgumentError? > As Yusuke & Yui stated in another thread [ruby-core:28440], the > hierarchy of errors might benefit in a restructuring. Even when that > happens, DomainError shouldn't be a subclass of ArgumentError, because > it might not be caused by an argument at all, like in my example: > -1.log, if #log was defined for Numerics. > > 3) Are there cases where ZeroDivisionError should not be also a > Math::DomainError? >