RosettaCodeData/Task/Literals-Floating-point/Nim/literals-floating-point.nim
2016-12-05 23:44:36 +01:00

12 lines
193 B
Nim

var x: float
x = 2.3
x = 2.0
x = 0.3
x = 123_456_789.000_000_1
x = 2e10
x = 2.5e10
x = 2.523_123E10
x = 5.2e-10
var y = 2'f32 # Automatically a float32
var z = 2'f64 # Automatically a float64