Update tests for integer division.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-08-18 13:15:34 +09:00
parent c8cf9512cd
commit ed32b6fcdc
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -56,8 +56,8 @@ end
assert 'Complex#/' do
assert_complex Complex(2, 3) / Complex(2, 3) , (1 + 0i)
assert_complex Complex(900) / Complex(1) , (900 + 0i)
assert_complex Complex(-2, 9) / Complex(-9, 2), ((36 / 85) - (77i / 85))
assert_complex Complex(9, 8) / 4 , ((9 / 4) + 2i)
assert_complex Complex(-2, 9) / Complex(-9, 2), ((36.0 / 85) - (77i / 85))
assert_complex Complex(9, 8) / 4 , ((9.0 / 4) + 2i)
assert_complex Complex(20, 9) / 9.8 , (2.0408163265306123 + 0.9183673469387754i)
if 1e39.infinite? then
# MRB_USE_FLOAT32 in effect
+1 -1
View File
@@ -36,7 +36,7 @@ assert('Numeric#/', '15.2.8.3.4') do
n = Class.new(Numeric){ def /(x); 15.1;end }.new
assert_equal(2, 10/5)
assert_equal(0.0625, 1/16)
assert_equal(0, 1/16)
assert_equal(15.1, n/10)
assert_raise(TypeError){ 1/n }
assert_raise(TypeError){ 1/nil }