diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-03 07:06:59 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-03 07:06:59 +0000 |
| commit | 93c02c4d033a0c643aa34d750178539b072f6c9f (patch) | |
| tree | c121d22a688bfe2c87a0ab5b20da2f057007aa97 | |
| parent | 3948410b044b80da78d27c622a419d4973a6d8b3 (diff) | |
* lib/complex.rb (Numeric#arg): should return NaN for NaN.
[ruby-core:24116]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | lib/complex.rb | 6 |
2 files changed, 6 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Fri Jul 3 06:19:58 2009 Yukihiro Matsumoto <matz@ruby-lang.org> + + * lib/complex.rb (Numeric#arg): should return NaN for NaN. + [ruby-core:24116] + Wed Jul 1 15:49:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * eval.c (PUSH_ANCHOR, POP_ANCHOR, rb_thread_start_0): separated diff --git a/lib/complex.rb b/lib/complex.rb index fbf50ffece..808cecc95d 100644 --- a/lib/complex.rb +++ b/lib/complex.rb @@ -58,11 +58,7 @@ class Numeric # See Complex#arg. # def arg - if self >= 0 - return 0 - else - return Math::PI - end + Math.atan2!(0, self) end alias angle arg |
