summaryrefslogtreecommitdiffstats
path: root/lib/cmath.rb
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
commitbd35f5bcbd28eef3885ee6bac265f209079754ff (patch)
treed3a04184fc096b910e0f0ed962d34caef4566b40 /lib/cmath.rb
parentc7acdcb5c35ae6317cdd6c72283979f68180141e (diff)
downloadruby-bd35f5bcbd28eef3885ee6bac265f209079754ff.tar.gz
ruby-bd35f5bcbd28eef3885ee6bac265f209079754ff.tar.xz
ruby-bd35f5bcbd28eef3885ee6bac265f209079754ff.zip
* lib/cmath.rb (log10): raised exception when the given number is
a negative real. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/cmath.rb')
-rw-r--r--lib/cmath.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/cmath.rb b/lib/cmath.rb
index 5b261ed6a..31c5a59c9 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)