diff --git a/ChangeLog b/ChangeLog index 8c77907360..c613c36719 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jul 3 06:19:58 2009 Yukihiro Matsumoto + + * lib/complex.rb (Numeric#arg): should return NaN for NaN. + [ruby-core:24116] + Wed Jul 1 15:49:13 2009 Nobuyoshi Nakada * 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