toBoolean

fun Int.toBoolean(): Boolean

Convert Int to Boolean.

Example:

0.toBoolean() // false
1.toBoolean() // true
-1.toBoolean() // IllegalArgumentException

Since

1.1.0

Throws

IllegalArgumentException

when n != 0 or n != 1.