diff options
author | wyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-14 19:28:58 +0000 |
---|---|---|
committer | wyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-14 19:28:58 +0000 |
commit | f57870844dd491bbe4dfce939fbd94948f04db4d (patch) | |
tree | 6174ad7ca61c348182b384b6bbf3aff9227a48fe /lib | |
parent | 63714e935a836313b16dce0e3036b747a1128d0e (diff) |
Adjust #angle/#arg NaN return as per issue #1715 and recent rubyspec changes. Adjust angle/arg handling of (-0.0).angle as per r23960 & recent rubyspec changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@24109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/complex.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/complex.rb b/lib/complex.rb index 9300f391e8..5b8ac25ff8 100644 --- a/lib/complex.rb +++ b/lib/complex.rb @@ -58,8 +58,10 @@ class Numeric # See Complex#arg. # def arg - if self >= 0 + if self > 0 || (self == 0 && self.to_s != '-0.0') # This string comparison stuff is gross. Better way? return 0 + elsif self.to_f.nan? + return self else return Math::PI end |