types.Bool.tofloat
Method on every
boolConverts the bool to a float.
Return value
1.0 for true, 0.0 for false - both print with no decimal point, see tostring.
Notes
Takes no arguments.
Example
println("true.tofloat() =", true.tofloat())
println("false.tofloat() =", false.tofloat())Output:
true.tofloat() = 1
false.tofloat() = 0See also
tointeger | Converts the bool to an integer. |
tostring | Converts the bool to its string form. |
tofloat | Converts the integer to a float. |
| bool | class index |