зеркало из https://github.com/github/ruby.git
* rational.c (nurat_cmp): use rb_num_coerce_cmp.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
b2fb759624
Коммит
f94228c8bd
|
@ -1,3 +1,7 @@
|
||||||
|
Sat Jun 27 16:56:33 2009 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
|
* rational.c (nurat_cmp): use rb_num_coerce_cmp.
|
||||||
|
|
||||||
Sat Jun 27 16:45:10 2009 Tadayoshi Funaba <tadf@dotrb.org>
|
Sat Jun 27 16:45:10 2009 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
* complex.c: revised rdoc.
|
* complex.c: revised rdoc.
|
||||||
|
|
|
@ -979,7 +979,7 @@ nurat_cmp(VALUE self, VALUE other)
|
||||||
return f_cmp(f_sub(num1, num2), ZERO);
|
return f_cmp(f_sub(num1, num2), ZERO);
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return rb_num_coerce_bin(self, other, id_cmp);
|
return rb_num_coerce_cmp(self, other, id_cmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -692,6 +692,9 @@ class Rational_Test < Test::Unit::TestCase
|
||||||
assert_equal(true, Rational(0) <= Rational(0))
|
assert_equal(true, Rational(0) <= Rational(0))
|
||||||
assert_equal(true, Rational(0) >= Rational(0))
|
assert_equal(true, Rational(0) >= Rational(0))
|
||||||
assert_equal(false, Rational(0) > Rational(0))
|
assert_equal(false, Rational(0) > Rational(0))
|
||||||
|
|
||||||
|
assert_equal(nil, Rational(0) <=> nil)
|
||||||
|
assert_equal(nil, Rational(0) <=> 'foo')
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_equal
|
def test_equal
|
||||||
|
|
Загрузка…
Ссылка в новой задаче