Merge pull request #6472 from dearblue/rational

This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-01-27 12:37:53 +09:00
committed by GitHub
2 changed files with 6 additions and 6 deletions
+5
View File
@@ -309,3 +309,8 @@ assert 'Rational#**' do
assert_float(16.0, (4r)**(2.0))
assert_float(3.5**1.5, (7/2r)**(1.5))
end
assert 'Integer#quo' do
a = 6.quo(5)
assert_equal 6/5r, a
end
+1 -6
View File
@@ -49,12 +49,7 @@ assert('Integer#/', '15.2.8.3.4') do
assert_equal 2.0, b
end
if Object.const_defined?(:Rational)
assert('Integer#quo') do
a = 6.quo(5)
assert_equal 5/6r, a
end
elsif Object.const_defined?(:Float)
if Object.const_defined?(:Float)
assert('Integer#quo') do
a = 6.quo(5)
assert_equal 1.2, a