mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merges r28815 from trunk into ruby_1_9_2.
-- * bignum.c (big_op): comparison of bignum and infinity has returned 1 or -1, but it must return boolean. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f62d8ce901
commit
6765d52c38
3 changed files with 10 additions and 2 deletions
|
|
@ -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 Jul 25 05:37:20 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* numeric.c (flo_cmp): honor the result of infinite? method of the
|
||||
|
|
|
|||
5
bignum.c
5
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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue