IEE754 conversion utils
This commit is contained in:
@@ -9,3 +9,15 @@ export function applyFills( orderStatus, filled ) {
|
|||||||
}
|
}
|
||||||
// console.log('applied fills', orderStatus)
|
// console.log('applied fills', orderStatus)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function encodeIEE754(value) {
|
||||||
|
const buffer = new ArrayBuffer(2);
|
||||||
|
new DataView(buffer).setFloat32(0, value, false /* big endian */);
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function decodeIEE754(buffer) {
|
||||||
|
return new DataView(buffer).getFloat32(0, false);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user