This doesn't work on Firefox, as it normalizes NaNs as they're extracted from ArrayBuffers. Presumably because SpiderMonkey uses NaN-boxing itself, and thus just doesn't have any way to represent actual non-canonical NaN floats.
f = new Float64Array(1)
dv = new DataView(f.buffer)
dv.setBigInt64(0, -123n)
console.log([...new Uint8Array(f.buffer)])
f = new Float64Array(1)
new BigUint64Array(f.buffer)[0] = -123n
console.log([...new Uint8Array(f.buffer)])
f = new Float64Array(1)
f[0] = new Float64Array(new BigUint64Array([-123n]).buffer)[0]
console.log([...new Uint8Array(f.buffer)])
f = new Float64Array([NaN])
console.log([...new Uint8Array(f.buffer)])