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 | 0b32755db23975fd7c6537039736a98e9cd7da1f (patch) | |
| tree | 6174ad7ca61c348182b384b6bbf3aff9227a48fe | |
| parent | ecfff9d26446be99bcff5743fd1d9a504ea3f230 (diff) | |
| download | ruby-0b32755db23975fd7c6537039736a98e9cd7da1f.tar.gz ruby-0b32755db23975fd7c6537039736a98e9cd7da1f.tar.xz ruby-0b32755db23975fd7c6537039736a98e9cd7da1f.zip | |
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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_6@24109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | lib/complex.rb | 4 | ||||
| -rw-r--r-- | version.h | 2 |
3 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,7 @@ +Tue Jul 14 13:14:00 2009 Kirk Haines <khaines@ruby-lang.org> + + * lib/complex.rb: 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. + Mon Jul 13 12:00:00 2009 Kirk Haines <khaines@ruby-lang.org> * numeric.c, bignum.c: Applied changes from r23730. Infinity is > any bignum number in comparisons. diff --git a/lib/complex.rb b/lib/complex.rb index 9300f391e..5b8ac25ff 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 @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2009-06-08" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20090608 -#define RUBY_PATCHLEVEL 379 +#define RUBY_PATCHLEVEL 380 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 |
