ruby-changes:17867
From: tadf <ko1@a...>
Date: Tue, 23 Nov 2010 07:32:02 +0900 (JST)
Subject: [ruby-changes:17867] Ruby:r29881 (trunk): * complex.c, rational.c ({nucomp,nurat}_expt): added a check.
tadf 2010-11-23 07:31:55 +0900 (Tue, 23 Nov 2010) New Revision: 29881 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29881 Log: * complex.c, rational.c ({nucomp,nurat}_expt): added a check. Modified files: trunk/ChangeLog trunk/complex.c trunk/rational.c Index: complex.c =================================================================== --- complex.c (revision 29880) +++ complex.c (revision 29881) @@ -1,5 +1,5 @@ /* - complex.c: Coded by Tadayoshi Funaba 2008,2009 + complex.c: Coded by Tadayoshi Funaba 2008-2010 This implementation is based on Keiju Ishitsuka's Complex library which is written in ruby. @@ -824,7 +824,7 @@ static VALUE nucomp_expt(VALUE self, VALUE other) { - if (k_exact_zero_p(other)) + if (k_numeric_p(other) && k_exact_zero_p(other)) return f_complex_new_bang1(CLASS_OF(self), ONE); if (k_rational_p(other) && f_one_p(f_denominator(other))) Index: ChangeLog =================================================================== --- ChangeLog (revision 29880) +++ ChangeLog (revision 29881) @@ -1,3 +1,7 @@ +Tue Nov 23 07:29:24 2010 Tadayoshi Funaba <tadf@d...> + + * complex.c, rational.c ({nucomp,nurat}_expt): added a check. + Tue Nov 23 07:27:27 2010 Tadayoshi Funaba <tadf@d...> * lib/date.rb (daynum): should be private. Index: rational.c =================================================================== --- rational.c (revision 29880) +++ rational.c (revision 29881) @@ -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 @@ 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)) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/