# .args. -number:float64 use System.Globalization class X shared def main x as number = 1 assert x == 1 x = 2 assert x == 2 x = 3.0 assert x == 3 assert x == 3n assert x == 3.0 x = 3n assert x == 3 assert x == 3n assert x == 3.0 x = 4.5 assert x == 4.5 one = 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 assert 1.0 <> one roundTripFormat = one.toString('R', CultureInfo.invariantCulture) assert roundTripFormat.startsWith('0.999999') i = 1 j = 2 x = i / j assert x == 0.5 x = 3.0 y = 4.0 assert .checkNumber(x, y) == 7.0 assert .checkNumber(x, y) == 7.0f assert .checkNumber(x, y) == 7.0f64 assert .checkFloat(x, y) == 7.0f assert .checkFloat64(x, y) == 7.0f64 def checkNumber(a as number, b as number) as number return a + b def checkFloat(a as float, b as float) as float return a + b def checkFloat64(a as float64, b as float64) as float64 return a + b