summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-07 13:46:56 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-07 13:46:56 +0000
commit5a066e60d9fe5462950a977f751927e1ca5b3053 (patch)
tree8f2d191d2c3b67134539b64b4ba95c2f46984c58
parent8b784d8b472baca1d4796c7bc87f5145c5aca3b0 (diff)
downloadruby-5a066e60d9fe5462950a977f751927e1ca5b3053.tar.gz
ruby-5a066e60d9fe5462950a977f751927e1ca5b3053.tar.xz
ruby-5a066e60d9fe5462950a977f751927e1ca5b3053.zip
* lib/cmath.rb (log): avoided redundant expression.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--lib/cmath.rb3
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ef3753475..aeaf9c2b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Jun 7 22:44:20 2009 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * lib/cmath.rb (log): avoided redundant expression.
+
Fri Jun 5 07:12:32 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/mkmf.rb (#link_command): should dup CONFTEST_C which is
diff --git a/lib/cmath.rb b/lib/cmath.rb
index 95a30c336..5b261ed6a 100644
--- a/lib/cmath.rb
+++ b/lib/cmath.rb
@@ -38,8 +38,7 @@ module CMath
if z.real? and z >= 0 and (b.nil? or b >= 0)
log!(*args)
else
- r, theta = z.polar
- a = Complex(log!(r.abs), theta)
+ a = Complex(log!(z.abs), z.arg)
if b
a /= log(b)
end