I propose to make @mulAdd more like the rest of the math operators built into the language, such as +. This would use Peer Type Resolution to chose a type, just like if you did a + b (except there are 3 values instead of 2).
I see no reason to limit this to floats; it should work just fine for integers too. This will make it more friendly in generic code.
What about all the other float operations?
Here's my counter-proposal, let's add a fn fma(a: var, b: var, c: var) @TypeOf(a, b, c) to std.math to handle the comptime and int cases and have it use @mulAdd on floats/vector of floats.
@mulAdd is a low-level builtin that has everything to do with rounding problems so extending it to other types makes little sense IMO.
related #4466
Most helpful comment
Here's my counter-proposal, let's add a
fn fma(a: var, b: var, c: var) @TypeOf(a, b, c)tostd.mathto handle the comptime and int cases and have it use@mulAddon floats/vector of floats.@mulAddis a low-level builtin that has everything to do with rounding problems so extending it to other types makes little sense IMO.