bool
bool(
v
?):boolean
Defined in: packages/typegpu/src/data/numeric.ts:55
A schema that represents a boolean value. (equivalent to bool
in WGSL)
Can also be called to cast a value to a bool in accordance with WGSL casting rules.
Parameters
Section titled “Parameters”number
| boolean
Returns
Section titled “Returns”boolean
Examples
Section titled “Examples”const value = bool(); // false
const value = bool(0); // false
const value = bool(-0); // false
const value = bool(21.37); // true