namespace Test class Test def main is shared # # true division # # two ints yield a decimal assert 3 / 4 == 0.75 assert 5 / 4 == 1.25 # decimal and int yield a decimal assert 3.0 / 4 == 0.75 assert 3 / 4.0 == 0.75 assert 3.0 / 4.0 == 0.75 # float and int yield float assert 3.0f / 4 == 0.75f assert 3 / 4.0f == 0.75f assert 3.0f / 4.0f == 0.75f # # floor division # assert 3 // 4 == 0 assert 5 // 4 == 1 assert 3.0 // 4.0 == 0.0 assert 3 // 4.0 == 0.0 assert 3.0 // 4.0 == 0.0 assert 3.0f // 4.0f == 0.0f assert 3 // 4.0f == 0.0f assert 3.0f // 4.0f == 0.0f # cannot mix float and decimal