Created
August 14, 2021 06:40
-
-
Save cd789/ebf4f2e2f17b5689e42f1849fd271523 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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