diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-25 09:53:31 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-25 09:53:31 +0000 |
commit | 164b237da1f1787cb1cd9e8d3bec79344b05f7df (patch) | |
tree | 5fedd30b8e8f7e9267ec77381657c9be7adc19d4 /lib | |
parent | a3401317cb697ff670d39d759d9b630c1e8560d9 (diff) |
merges r20938 from trunk into ruby_1_9_1.
* lib/mathn.rb: Math.sqrt(NaN) should be NaN. [ruby-dev:37537]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mathn.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/mathn.rb b/lib/mathn.rb index 48cb99f8c6..0241f578e9 100644 --- a/lib/mathn.rb +++ b/lib/mathn.rb @@ -134,6 +134,8 @@ module Math else Complex(x, -y) end + elsif a.respond_to?(:nan?) and a.nan? + a elsif a >= 0 rsqrt(a) else |