Loading

TOBOOLEAN


conversion
Since v1.0.5
Available on all platforms
See also

Converts a value of primitive type into a boolean value.

The TOBOOLEAN function consumes a parameter (BOOLEAN, LONG, DOUBLE, STRING) from the top of the stack and pushes back its conversion to boolean. Numbers will be false if they are equal to 0 and true otherwise. Strings will be false if they are equals to '' and true otherwise.

Signature

Examples

'warp 10' TOBOOLEAN // true '' TOBOOLEAN // false 0 TOBOOLEAN // false 42 TOBOOLEAN // true 0.0 TOBOOLEAN // false 3.14 TOBOOLEAN // true true TOBOOLEAN // true false TOBOOLEAN // false