summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--complex.c6
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a1fdcc27d..ab603cf495 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,13 @@ Thu Jul 22 20:58:55 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (RUBY_EXTERN): unnecessary after all.
+Thu Jul 22 17:33:47 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * complex.c (nucomp_to_i): allow complex with imaginary zero to be
+ converted.
+
+ * complex.c (nucomp_to_f, nucomp_to_r): ditto.
+
Thu Jul 22 20:12:56 2010 Yusuke Endoh <mame@tsg.ne.jp>
* thread_pthread.c (get_stack): fix memory leak; pthread_attr_destory
diff --git a/complex.c b/complex.c
index 51918c7f3c..eb9ceaeac6 100644
--- a/complex.c
+++ b/complex.c
@@ -1295,7 +1295,7 @@ nucomp_to_i(VALUE self)
{
get_dat1(self);
- if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ if (f_nonzero_p(dat->imag)) {
VALUE s = f_to_s(self);
rb_raise(rb_eRangeError, "can't convert %s into Integer",
StringValuePtr(s));
@@ -1314,7 +1314,7 @@ nucomp_to_f(VALUE self)
{
get_dat1(self);
- if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ if (f_nonzero_p(dat->imag)) {
VALUE s = f_to_s(self);
rb_raise(rb_eRangeError, "can't convert %s into Float",
StringValuePtr(s));
@@ -1333,7 +1333,7 @@ nucomp_to_r(VALUE self)
{
get_dat1(self);
- if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ if (f_nonzero_p(dat->imag)) {
VALUE s = f_to_s(self);
rb_raise(rb_eRangeError, "can't convert %s into Rational",
StringValuePtr(s));