madd()
Function in Builtins
Multiply-add, a*b + c, written as the plain a.mul(b).add(c) chain.
import { madd } from 'typeshade/core/ir'
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
Syntax
const madd: <K extends string>( a: ReadonlyNode<K>, b: NoInfer<ArithArg<K>>, c: NoInfer<ArithArg<K>>,) => Node<K>Parameters
aReadonlyNode<K>bNoInfer<ArithArg<K>>cNoInfer<ArithArg<K>>
Return value
Node<K>
Description
To emit WGSL’s
multiply-add builtin use fma; neither form guarantees a single rounding.
See also
Source
src/core/ir/node.ts, line 2486, at commit af54ddad5