-
Notifications
You must be signed in to change notification settings - Fork 726
New issue
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
[Help] How to literal a very large number? #1078
Comments
Use the hex syntax. The correct syntax for the max value is: 0x1.fffffffffffffp1023 The problem with the decimal syntax is that you have already exceed the maximum through rounding. In Java the max double in decimal is 1.7976931348623157e+308. This is a little smaller. |
Right, you can see that these numbers produce the same value in the wat2wasm demo: (func
f64.const 1.7976931348623157e+308
f64.const 0x1.fffffffffffffp1023
return) output:
|
Oh, yes, many thanks to @Horcrux7, i found that too, the max value of double type in VB.NET is becomes bigger after default precision rounding in .NET Framework, so value ;; Double.MaxValue.ToString("G17")
;; this works
(global $Double.MaxValue (mut f64) (f64.const 1.7976931348623157e+308)) Hi, @binji , 😆 i think use this
|
@xieguigang good point, opened #1080. |
Hi,
Help needed, today I test for a max value literal of the
f64
number, and have error reports when convert wast to wasm binary:The value of
Double.MaxValue
its literal value in .NET Framework is 1.79769313486232E+308, but it seems that such literal syntax in scientific notation is not valid in WebAssembly S-ExpressionI have check for the documents in repository WebAssembly/design, but didn't find something about literal a large number.
Here are some necessary information for reproduce this error:
The text was updated successfully, but these errors were encountered: