num-traits
num-traits copied to clipboard
`Float` should imply `MulAdd`, instead of having own `mul_add` method.
In generic code I would like Float bound to be enough to use it where MulAdd is expected given there is Float::mul_add, so trait can always be implemented.
Maybe even put it under NumOps since Mul + Add is enough to implement this trait, with fusion for types that support it and as a * b + c for other types.
Maybe even put it under
NumOpssinceMul + Addis enough to implement this trait,
This only works if all of the RHS and Output types are the same.
Anyway, it would be a breaking change to require the relatively new MulAdd on the older traits, but you can easily create your own trait NewNum: Sized + NumOps + MulAdd<Output = Self> {}.