1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!anko
# toInt with ints, floats, strings, bools
println("\ntoInt examples:\n===============")
i = 1<<63 - 1
println("int", i, "toInt:", toInt(i))
i = -1 << 63
println("int", i, "toInt:", toInt(i))
f = 3.141592653589793
println("float", f, "toInt:", toInt(f))
f = 1.797693134862315708145274237317043567981e18
println("float", f, "toInt:", toInt(f))
f = -1.797693134862315708145274237317043567981e18
println("float", f, "toInt:", toInt(f))
s = "4611686018427387904"
println("string", s, "toInt:", toInt(s))
s = "-9223372036854775808"
Enter to Rename, <Shift>+Enter to Preview