diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-22 22:31:55 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-22 22:31:55 +0000 |
commit | 1d8ca7a237825a4d606e08ff3544aa6a8489f6f9 (patch) | |
tree | 525502c8c9b61db2070e7a4076d4b19959c606fb /rational.c | |
parent | 6e9ca6484380cfe2d5ba25c3cd31133afe64105a (diff) | |
download | ruby-1d8ca7a237825a4d606e08ff3544aa6a8489f6f9.tar.gz |
* complex.c, rational.c ({nucomp,nurat}_expt): added a check.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r-- | rational.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rational.c b/rational.c index 9334b14352..2aec3e264a 100644 --- a/rational.c +++ b/rational.c @@ -1,5 +1,5 @@ /* - rational.c: Coded by Tadayoshi Funaba 2008,2009 + rational.c: Coded by Tadayoshi Funaba 2008-2010 This implementation is based on Keiju Ishitsuka's Rational library which is written in ruby. @@ -929,7 +929,7 @@ nurat_fdiv(VALUE self, VALUE other) static VALUE nurat_expt(VALUE self, VALUE other) { - if (k_exact_zero_p(other)) + if (k_numeric_p(other) && k_exact_zero_p(other)) return f_rational_new_bang1(CLASS_OF(self), ONE); if (k_rational_p(other)) { |