Skip to content

f16

f16(v?): number

Defined in: packages/typegpu/src/data/numeric.ts:287

A schema that represents a 16-bit float value. (equivalent to f16 in WGSL)

Can also be called to cast a value to an f16.

number | boolean

number

const value = f16(); // 0
const value = f32(1.23); // 1.23
const value = f16(true); // 1
const value = f16(21877.5); // 21872