Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upTyped Array: What about i64? #1316
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
devsnek
Sep 28, 2018
Contributor
JS number values are ieee754 floating point. BigInt however is stage 3 and adds Big(U)Int64Array. cc @linclark on any story involving i64 and bigint.
|
JS number values are ieee754 floating point. BigInt however is stage 3 and adds |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
lorenzleutgeb
Sep 28, 2018
OK, I think that additions like DataView.setBigInt64 et. al. would serve my purposes.
Also I discovered WebAssembly/spec#707. Sorry for the noise.
lorenzleutgeb
commented
Sep 28, 2018
•
|
OK, I think that additions like Also I discovered WebAssembly/spec#707. Sorry for the noise. |
lorenzleutgeb
closed this
Sep 28, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lorenzleutgeb commentedSep 28, 2018
I am writing JavaScript code that interfaces with WebAssembly. The WebAssembly memory is exposed as an
ArrayBufferwhich I wrap in aUint8Arrayand aDataViewfor access.WebAssembly values are typed as
i32,i64,f32,f64. Three of them are nicely mirrored in the typed array world and WebIDL. However,i64is missing theInt64Array,Uint64ArrayandDataView.setInt64,DataView.setUint64counterparts.I tried to find out why they are not standardized, but was not successful. In my opinion that would be a reasonable addition.
I see that JavaScript's
Number.MAX_SAFE_INTEGERis less than 2^64, is that the "reason"? Writing values up to that number to some buffer usingDataView.set(Ui|I)nt64should not be a problem, reading unsafe integers however requires consideration.Note that I arrived here via a slight detour through heycam/webidl#586