We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Number
JavaScript Number is float64 type. Integers outside of Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER can't be represented.
Number.MAX_SAFE_INTEGER
Number.MIN_SAFE_INTEGER
Out current code from emscripten is
getValue
case 'i64': return HEAP32[((ptr)>>2)];
And setValue
case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math.min((+(Math.floor((tempDouble)/4294967296.0))), 4294967295.0))|0)>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)],HEAP32[((ptr)>>2)] = tempI64[0],HEAP32[(((ptr)+(4))>>2)] = tempI64[1]); break;
Net 7.0 preview 4 and below on WASM.
Use available 52 bits both directions and throw on overflow. Give user option to marshal also as BigInt
BigInt
Value is trimmed to 32bits only.
No
use double on C# side too.
double
The text was updated successfully, but these errors were encountered:
Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.
Use available 52 bits both directions and throw on overflow.
No response
arch-wasm, area-System.Runtime.InteropServices.JavaScript
arch-wasm
area-System.Runtime.InteropServices.JavaScript
Sorry, something went wrong.
pavelsavara
Successfully merging a pull request may close this issue.
Description
JavaScript
Number
is float64 type. Integers outside ofNumber.MAX_SAFE_INTEGER
andNumber.MIN_SAFE_INTEGER
can't be represented.Out current code from emscripten is
getValue
And setValue
Reproduction Steps
Net 7.0 preview 4 and below on WASM.
Expected behavior
Use available 52 bits both directions and throw on overflow.
Give user option to marshal also as
BigInt
Actual behavior
Value is trimmed to 32bits only.
Regression?
No
Known Workarounds
use
double
on C# side too.The text was updated successfully, but these errors were encountered: