vmichalak
09/21/2018, 1:06 PMkarelpeeters
09/21/2018, 1:15 PMvmichalak
09/21/2018, 1:17 PMkarelpeeters
09/21/2018, 1:19 PM3 pow 5
sometimes dammit!spand
09/21/2018, 1:21 PMStrictMath
littlelightcz
09/23/2018, 10:34 AM3 pow 5
would be a Double
, then why not - that should be fine.karelpeeters
09/23/2018, 10:37 AMDouble
powers, we have that already.karelpeeters
09/23/2018, 10:37 AMlittlelightcz
09/23/2018, 2:33 PM9 pow 10
should already overflow the Int.MAX_VALUE
. So from my point of view the range of numbers you could realistically use in such function is so narrow, that it doesn't even make much of a sense 🙂. Anyway if you never use bigger nums in the second argument, let's say than 5, then perhaps you could write your own extension function which might have some realistic use for you, but I would bet that you will overflow the Int MAX_VALUE very soon though 😁karelpeeters
09/23/2018, 2:46 PM50_000 * 50_000
already overflows.littlelightcz
09/23/2018, 2:58 PMkarelpeeters
09/23/2018, 3:00 PMilya.gorbunov
09/25/2018, 10:54 PMpow
operation for ints, what would you expect it to do in case of an overflow:
- throw some exception, e.g. ArithmeticException
- return some value, e.g. the result mod 2^31 or 2^32 for unsigned ints?
Would it be a suitable behavior in the cases, where you need it?karelpeeters
09/25/2018, 11:00 PMStrictMath
.karelpeeters
09/25/2018, 11:02 PMStrictMath
yet, is there a multiplatform way to have exceptions throws when plus
overflows?