mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* 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
This commit is contained in:
parent
3948410b04
commit
93c02c4d03
2 changed files with 6 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue