Returns 1 when this value is true and 0 when it is false.
1
true
0
false
Useful for counting flags, for example flags.sumOf { it.toInt() }.
flags.sumOf { it.toInt() }