-
Notifications
You must be signed in to change notification settings - Fork 174
Minimal integer -(2**256)
makes FunC compilation fail
#339
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
Comments
Additional context: tact-lang/tact-docs#206 (comment) This works ( dump(
-(pow2(255) - 1 + pow2(255)) // -(2**256 - 1)
); This throws an exit code 4, while it should've fit ( dump(
-(pow2(255) - 1 + pow2(255)) // -(2**256 - 1) - 1
- 1
); |
in both cases (#339 (comment) and #339 (comment)) you compute positive number first and then negate it via integers in TVM are signed 257-bit, which are numbers in range I guess we have to make some change in Tact's way of handling integer constants in order to fix the problem. |
Hmm, I definitely compute
May be the case indeed |
|
interestingly, defining integer constants with these values works (for all of the snippets above), but trying to pass the value without an intermediate constant variable produces an error. here's the result (in the first case integer literal is being generated correctly and in the second case incorrectly)
|
The following snippet
produces the following FunC compilation error:
Reported by @novusnota.
The text was updated successfully, but these errors were encountered: