Skip to content

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.

number | boolean

boolean

const value = bool(); // false
const value = bool(0); // false
const value = bool(-0); // false
const value = bool(21.37); // true