We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
IS_LE
1 parent ebcfcc7 commit ee47a7fCopy full SHA for ee47a7f
packages/binary/src/float.ts
@@ -2,13 +2,14 @@ import type { FnN, FnN2 } from "@thi.ng/api";
2
3
const F64 = new Float64Array(1);
4
const F32 = new Float32Array(F64.buffer);
5
+const U8 = new Uint8Array(F64.buffer);
6
const I32 = new Int32Array(F64.buffer);
7
const U32 = new Uint32Array(F64.buffer);
8
9
/**
10
* This value is true iff the environment is Little Endian.
11
*/
-export const IS_LE = ((F64[0] = 2), U32[1] === 0x40000000);
12
+export const IS_LE = ((U32[0] = 1), U8[0] === 1);
13
14
export const floatToIntBits: FnN = (x) => ((F32[0] = x), I32[0]);
15
0 commit comments