Is there a max number of int inputs when declaring an input to an integer. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is there a max number of int inputs when declaring an input to an integer.

var x = readLine()!!.toInt() because I realized an error occurs if up to 11digits are inputted

30th Jun 2021, 1:29 AM
mofe_sanya
mofe_sanya - avatar
1 Answer
+ 3
Yes, the type Int has a MAX_VALUE and a MIN_VALUE in Kotlin. Int.MAX_VALUE // 2,147,483,647 Int.MIN_VALUE // -2,147,483,648 https://kotlinlang.org/docs/basic-types.html#integer-types
30th Jun 2021, 1:47 AM
ChaoticDawg
ChaoticDawg - avatar