type
double
double
A double is an IEEE-754 double-precision number: about sixteen significant digits. Use it where a float loses precision — large world coordinates, accumulated time, geodesy — and convert to float at the boundary to the GPU.
It behaves like float: decimal literals take its type from context, int and long promote to it, and a float mixed with a double widens to double. Narrowing back is explicit: float(d).
Example
program Precise {
entry {
let total: double = 0.1
print(total + 0.2) # 0.30000000000000004
let small: float = float(total)
print(small) # 0.1
}
}