toBoolean
Convert Int to Boolean.
Example:
0.toBoolean() // false
1.toBoolean() // true
-1.toBoolean() // IllegalArgumentException
Content copied to clipboard
Since
1.1.0
Throws
IllegalArgumentException
when n != 0 or n != 1.
Convert Int to Boolean.
Example:
0.toBoolean() // false
1.toBoolean() // true
-1.toBoolean() // IllegalArgumentException
1.1.0
when n != 0 or n != 1.