-
Notifications
You must be signed in to change notification settings - Fork 10
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
Issue with large number due to shell.evaluate under Eval.me #5
Comments
How about reducing |
Thanks you for your answer. I can't because I already publish apk with a high versionCode. I think the real question is why "codeTemplate '${major}(100000000) + ${minor}(10000) +${build}'" return a negative number ? because 25 * 100000000+1 * 10000 + 1197 < 2,147,483,647 (Integer Max value) |
That's interesting indeed, let me check. |
@thelittlefireman have you tried to execute this on the groovy console? print((int) 2500011198) And 2500011198 is clearly greater than Integer.MAX_VALUE. |
Versionberg/versionberg/src/main/groovy/io/github/rockerhieu/versionberg/Versionberg.groovy
Line 64 in bf2e9f0
i have huge issue with this script :
it always return negative value due tu integer overflow
after some reseach and test on https://groovyconsole.appspot.com/
the codeTemplate is working when you add L at the end of large number :
'25*(100000000) + 1*(10000) +1198'
= -1794956098'25*(100000000L) + 1*(10000L) +1198'
= 2500011198i try :
codeTemplate '${major}*(100000000L) + ${minor}*(10000L) +${build}'
but doesn't work i still got negative value. 😕Any help, or ideas ?
thanks
thomas
The text was updated successfully, but these errors were encountered: