bool
bool(
v?):boolean
Defined in: packages/typegpu/src/data/numeric.ts:56
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(); // falseconst value = bool(0); // falseconst value = bool(-0); // falseconst value = bool(21.37); // true