f64

f64, data type

f64 is a 64-bit IEEE 754 floating-point number, formerly named double. The name double remains an alias. Each value occupies 8 bytes, twice the numeric storage of a number value.

This type is useful when single precision is insufficient, for example for an accumulator in a def process. It provides about 15 to 16 significant decimal digits, but does not make decimal arithmetic exact.

Supported operations

Examples

The accumulator below retains the unit added between two large values:

table T = with
  [| as Step, as Value |]
  [| 1, 16777216 |]
  [| 2, 1 |]
  [| 3, -16777216 |]

def process preciseSum(x : number) with
  keep total = to.f64(0)
  total = total + to.f64(x)
  return to.number(total)

result = preciseSum(T.Value) sort T.Step
show scalar "Sum" a1b2 with result // 1

The state total remains f64; only the returned value is converted to number. With a number accumulator, adding 1 to 16777216 would lose the increment, and this sequence would end at 0.

Limitations

Writing f64 values to a file is not supported, including through path schemas or implicit column selection. Converting to number for output can lose precision. Conversion to f64 cannot recover precision already lost in the input values.

See also

User Contributed Notes
0 notes + add a note