ok so I'm just getting started in scala.. ran into a weird problem with a large number.
import Math._
var num:Long=0
num+=600851475
num*=1000
println(num)
that code works fine, yet the following doesn't compile with an error saying the integer is too large.
import Math._
var num:Long=0
num+=600851475000
println(num)
what's up? can scala not handle a 12-digit number? :/
Your constant should be 600851475000L
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