Skip to content

Instantly share code, notes, and snippets.

@cd789
Created Aug 14, 2021
Embed
What would you like to do?
class Helpers {
constructor() {
this.buf = new ArrayBuffer(8);
this.f64 = new Float64Array(this.buf);
this.u32 = new Uint32Array(this.buf);
}
ftoil(f) {
this.f64[0] = f;
return this.u32[0]
}
ftoih(f) {
this.f64[0] = f;
return this.u32[1]
}
printhex(val) {
console.log('0x' + val.toString(16));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment