to.f64

to.f64, function

def const pure to.f64(a: number): f64
def const pure to.f64(a: i64): f64

Converts a to a 64-bit floating-point value.

Examples

x = to.i64(42)
y = to.f64(x)

show scalar "Converted value" with to.number(y) // 42

x has type i64 and y has type f64. to.number converts the result back to single precision for display.

Remarks

This function is available in const expressions. to.double is an alias of to.f64, and double is an alias of the f64 type.

Converting a number preserves its value but does not recover precision already lost in single precision. Converting a large i64 can lose integer precision, because f64 cannot represent every 64-bit integer exactly. Converting back with to.number can also lose precision.

f64 columns cannot be exported with write.

See also

User Contributed Notes
0 notes + add a note