types.Bool.tointeger
Method on every
boolConverts the bool to an integer.
Return value
1 for true, 0 for false.
Notes
Takes no arguments, the same fixed arity as types.Integer.tointeger; there is no base parameter here either.
Example
println("true.tointeger() =", true.tointeger())
println("false.tointeger() =", false.tointeger())Output:
true.tointeger() = 1
false.tointeger() = 0See also
tofloat | Converts the bool to a float. |
tostring | Converts the bool to its string form. |
tointeger | Returns the integer itself. |
| bool | class index |