summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--bignum.c5
-rw-r--r--test/ruby/test_bignum.rb2
3 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5c6db1a4a2..089d829fd0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Aug 1 09:35:35 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * bignum.c (big_op): comparison of bignum and infinity has returned 1
+ or -1, but it must return boolean.
+
Sun Aug 1 09:44:25 2010 Tanaka Akira <akr@fsij.org>
* class.c (rb_include_module): don't clear the method cache if the
diff --git a/bignum.c b/bignum.c
index 24f13403b3..c2ceca74d8 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1453,8 +1453,9 @@ big_op(VALUE x, VALUE y, int op)
double a = RFLOAT_VALUE(y);
if (isinf(a)) {
- if (a > 0.0) return INT2FIX(-1);
- else return INT2FIX(1);
+ if (a > 0.0) rel = INT2FIX(-1);
+ else rel = INT2FIX(1);
+ break;
}
rel = rb_dbl_cmp(rb_big2dbl(x), a);
break;
diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb
index 5cff48c4d7..13b5b9dbe0 100644
--- a/test/ruby/test_bignum.rb
+++ b/test/ruby/test_bignum.rb
@@ -185,6 +185,8 @@ class TestBignum < Test::Unit::TestCase
assert(T31P < T64P)
assert(T64P > T31P)
assert_raise(ArgumentError) { T31P < "foo" }
+ assert(T64 < (1.0/0.0))
+ assert(!(T64 > (1.0/0.0)))
end
def test_eq