diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-08 14:18:02 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-08 14:18:02 +0000 |
commit | 088455448bfa4b610f6b72a7a8d80fad3f354d78 (patch) | |
tree | 988863846d9e2dd08697026535d1974293f86d98 | |
parent | 336a8c7ec30430b77fd4aec0dfc6399562b71826 (diff) | |
download | ruby-088455448bfa4b610f6b72a7a8d80fad3f354d78.tar.gz ruby-088455448bfa4b610f6b72a7a8d80fad3f354d78.tar.xz ruby-088455448bfa4b610f6b72a7a8d80fad3f354d78.zip |
* complex.c (nucomp_div): omitted zero division check.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | complex.c | 6 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,7 @@ +Wed Jul 8 23:13:54 2009 Tadayoshi Funaba <tadf@dotrb.org> + + * complex.c (nucomp_div): omitted zero division check. + Wed Jul 8 21:00:37 2009 Keiju Ishitsuka <keiju@emperor2.pendome> * lib/irb/inspector.rb: forget svn add. @@ -758,8 +758,10 @@ f_divide(VALUE self, VALUE other, static VALUE nucomp_div(VALUE self, VALUE other) { - if (f_zero_p(other)) +#if 0 /* too much cost */ + if (f_zero_p(other) && k_exact_p(self) && k_exact_p(other)) rb_raise_zerodiv(); +#endif return f_divide(self, other, f_quo, id_quo); } @@ -824,7 +826,7 @@ rb_fexpt(VALUE x, VALUE y) static VALUE nucomp_expt(VALUE self, VALUE other) { - if (k_exact_p(other) && f_zero_p(other)) + if (f_zero_p(other) && k_exact_p(other)) return f_complex_new_bang1(CLASS_OF(self), ONE); if (k_rational_p(other) && f_one_p(f_denominator(other))) |