#.require. clr # This is clr specific re inheritance of literals and floats namespace Test class Test def main is shared f as float = 1.0f assert f assert f==1.0f assert f==1 sum as float = 0.1f+0.1f+0.1f+0.1f+0.1f+0.1f+0.1f+0.1f+0.1f+0.1f assert sum<>1.0f assert sum<>0.1f*10 assert 1.0f inherits float # .warning. is always assert not (1 inherits float) # .warning. is never g as float = 2f assert g assert g == 2.0f assert g == 2.00f assert g == 2 assert g == f + f # small numbers a = 0.00001f b = 0.000001f assert a > b # can assign ints to floats f = 7 # can compare ints and floats assert f > 0 assert 0 < f # minValue and maxValue assert float.minValue <= int.minValue assert float.maxValue >= int.maxValue .testAugmentedAssignment def testAugmentedAssignment is shared f as float = 1.0f f += 1.0f assert f == 2.0f f += 2.125f assert f == 4.125f f -= 2.125f assert f == 2.0f f *= 2.0f assert f == 4.0f f /= 2.0f assert f == 2.0f f = 3.0f f //= 5.0f assert f == 0