class X def main is shared X().run def run .testFloat .testFloat32 .testFloat64 .testCompare .testFloatLits def testFloat i as float = 2.0f j as float = 4.0f k as float = i * j assert k == 8 def testFloat32 i as float32 = 2f32 j as float32 = 4.0f32 assert i < j assert j > i .passFloat32(j) j = 4_f32 j = 4.0_f32 def passFloat32(x as float32) assert x def testFloat64 i as float64 = 2f j as float64 = 4f i = 2 j = 4 k as float64 = i * j assert k == 8.0f def testCompare f32 = 5.0f to float32 assert f32 > 0 f64 = 10.0f to float64 # .warning. typecast is redundant assert f32 < f64 assert f64 > f32 assert f32 <> 0 assert f32 <> 64 assert f64 <> f32 f64 = 5 assert f32 == f64 assert f64 == f32 def testFloatLits f32a as float32 = 0 f32b as float32 = -1 f64a as float64 = 0 f64b as float64 = -1 CobraCore.noOp(f32a, f32b, f64a, f64b)