# encodeFloat64Key

> **encodeFloat64Key**(`value`): `Uint8Array`

Defined in: [packages/key-encoding/src/scalars.ts:153](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/key-encoding/src/scalars.ts#L153)

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 `===`.

## Parameters

### value

`number`

## Returns

`Uint8Array`

## Throws

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