aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-09 13:43:49 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-09 13:43:49 +0000
commita6afbaeb3be396c0fdea3b9077d9256c59edcfca (patch)
treed3a04184fc096b910e0f0ed962d34caef4566b40
parentd1dd8717079593f582c00acbf8b2e17cb529f6e1 (diff)
downloadruby-a6afbaeb3be396c0fdea3b9077d9256c59edcfca.tar.gz
* lib/cmath.rb (log10): raised exception when the given number is
a negative real. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/cmath.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f85e186121..32c68c9416 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jun 9 22:38:09 2009 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * lib/cmath.rb (log10): raised exception when the given number is
+ a negative real.
+
Tue Jun 9 15:13:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (dir_s_glob): fixed rdoc. a patch from Joseph Pecoraro a
diff --git a/lib/cmath.rb b/lib/cmath.rb
index 5b261ed6a8..31c5a59c99 100644
--- a/lib/cmath.rb
+++ b/lib/cmath.rb
@@ -47,7 +47,7 @@ module CMath
end
def log10(z)
- if z.real?
+ if z.real? and z >= 0
log10!(z)
else
log(z) / log!(10)