Skip to content

encodeFloat64Key(value): Uint8Array

Defined in: packages/key-encoding/src/scalars.ts:153

Encode a double as 8 bytes that sort in numeric order: -Infinity first, Infinity last.

Takes the IEEE-754 big-endian bits, flips the sign bit of a non-negative value and every bit of a negative one. -0 is written as +0, so the two zeros share one key, as they do under ===.

number

Uint8Array

INVALID_KEY_VALUE when value is NaN or not a number, because NaN has no place in a total order.