Bugs: Browse | Submit New | Admin

[#23470] Math.hypot(0.0 / 0, 0.0) throws Errno::EDOM

Date:
2009-01-06 13:57
Priority:
3
Submitted By:
Daniele Alessandri (nrk)
Assigned To:
Tomas Matousek (tmat)
Category:
None
State:
Open
Summary:
Math.hypot(0.0 / 0, 0.0) throws Errno::EDOM

Detailed description
Math.hypot(0.0 / 0, 0.0) throws an Errno::EDOM instead of returning a NaN value. MRI and JRuby return a Float instance
(NaN value). See below:

IronRuby (SVN r181):
>>> Math.hypot(0.0 / 0, 0.0)
C:\Sviluppo\ironruby\SVN\trunk\src\IronRuby.Libraries\Builtins\RubyMath.cs:133:in `hypot':
 Domain error - Domain error - hypot (Errno::EDOM)
        from :0

MRI 1.8.6
irb(main):001:0> Math.hypot(0.0 / 0, 0.0)
=> NaN

I guess this different behaviour could be easily fixed by simply removing the call to the DomainCheck method in the
Hypot method of IronRuby.Builtins.RubyMath.

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
assigned_tonone2009-01-07 01:23tmat