Suppress too big exponent warnings

This commit is contained in:
Nobuyoshi Nakada 2020-12-28 12:12:54 +09:00
Родитель 228ad7d84b
Коммит 64d79d333b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 7CD2805BFA3770C6
1 изменённых файлов: 15 добавлений и 5 удалений

Просмотреть файл

@ -105,14 +105,24 @@ describe :rational_exponent, shared: true do
# Fails on linux due to pow() bugs in glibc: http://sources.redhat.com/bugzilla/show_bug.cgi?id=3866 # Fails on linux due to pow() bugs in glibc: http://sources.redhat.com/bugzilla/show_bug.cgi?id=3866
platform_is_not :linux do platform_is_not :linux do
it "returns positive Infinity when self < -1" do it "returns positive Infinity when self < -1" do
(Rational(-2) ** bignum_value).infinite?.should == 1 -> {
(Rational(-2) ** (bignum_value + 1)).infinite?.should == 1 (Rational(-2) ** bignum_value).infinite?.should == 1
(Rational(fixnum_min) ** bignum_value).infinite?.should == 1 }.should complain(/warning: in a\*\*b, b may be too big/)
-> {
(Rational(-2) ** (bignum_value + 1)).infinite?.should == 1
}.should complain(/warning: in a\*\*b, b may be too big/)
-> {
(Rational(fixnum_min) ** bignum_value).infinite?.should == 1
}.should complain(/warning: in a\*\*b, b may be too big/)
end end
it "returns 0.0 when self is < -1 and the exponent is negative" do it "returns 0.0 when self is < -1 and the exponent is negative" do
(Rational(-2) ** -bignum_value).should eql(0.0) -> {
(Rational(fixnum_min) ** -bignum_value).should eql(0.0) (Rational(-2) ** -bignum_value).should eql(0.0)
}.should complain(/warning: in a\*\*b, b may be too big/)
-> {
(Rational(fixnum_min) ** -bignum_value).should eql(0.0)
}.should complain(/warning: in a\*\*b, b may be too big/)
end end
end end
end end