So here's a summary of the changes that Kenta and I propose, followed
by final questions for everyone.

** Compared to Ruby 1.8:

 - New Exception class: DomainError, raised by mathematical functions
for inputs without well defined results
 - Errno::EDOM and Errno::ERANGE are no longer raised.
 - Corner cases are now platform independent; a few deviate from SUSv3
(see below)

** Interpretation of SUSv3:

 - Domain Errors: Ruby 1.9 raises a DomainError in these cases
 - Pole Errors: Ruby 1.9 returns +-Infinity, as appropriate.
 - Range Errors: Ruby 1.9 returns the under/overflowed result.

** Ruby 1.9 deviates from SUSv3 in a few corner cases:

 - Math.atan2(+-0.0, +-0.0) raises a DomainError (instead of returning
+-pi/2 or +-0.0)
 - Math.atan2(+-Infinity, +-Infinity) raises a DomainError (instead of
returning +-pi/4 or +-3pi/4)
 - Math.lgamma(-Infinity) raises a DomainError (instead of returning +Infinity)
 - Math.sqrt(-0.0) returns 0.0  (instead of -0.0)



** Remaining questions

 1) Is it ok if 0.0/0.0 raises a DomainError instead of returning NaN?

This has the benefits of making the treatment of domain errors
consistent. The only way to get a NaN from a calculation would then be
to explicitly use Float::NAN for an input.
This might imply some incompatibilities, though?
Should Ruby 1.8.7/8 issue a warning?

2) Should DivisionByZero error be a subclass of DomainError?

I feel it should, but I don't know how much changes to error class
hierarchy should be avoided.

3) Should the new DomainError be a subclass of ArgumentError, or of
RuntimeError?

ArgumentError makes sense to me, but I'm not sure why it was
originally chosen that DivisionByZero was not an ArgumentError.

4) Since we never raise Errno::EDOM and Errno::ERANGE, should they
still be defined?

Removing them might cause incompatibilities (?) but keeping them might
give the wrong impression.


Hopefully others can chime in on these 4 questions?