I am trying to do something like this in Kotlin
:
val top : Long = 1000000_1000000_1000000_1000000_1000000_1000000_1000000
In Java
it looks like this:
long TOP = 1000000_1000000_1000000_1000000_1000000_1000000_1000000L;
The Java
version works just fine, in Kotlin I get an error:
The value is out of range
Does anyone have an idea on how to do it? Thanks in advance.
You can do like below in Kotlin
, prefix 0b
for Long
representation.
val top : Long = 0b1000000_1000000_1000000_1000000_1000000_1000000_1000000
For more info on this, please check the documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With