1
0
Fork 0

Issue #4907: Config: Get rid of "floating pow()".

master
Sebastian Kaspari 2019-08-26 17:09:23 +02:00
parent be76a383b6
commit be8b789e62
1 changed files with 2 additions and 2 deletions

View File

@ -109,8 +109,8 @@ object Config {
when {
base < 0 -> throw RuntimeException("Cannot calculate versionCode. Hours underflow.")
base > pow(2.0, 17.0) -> throw RuntimeException("Cannot calculate versionCode. Hours overflow.")
base > (pow(2.0, 17.0) - (366 * 24)) ->
base > 0x20000 /* 2^17 */ -> throw RuntimeException("Cannot calculate versionCode. Hours overflow.")
base > 0x20000 - (366 * 24) ->
// You have one year to update the version scheme...
throw RuntimeException("Running out of low order bits calculating versionCode.")
}