Open zakarumych opened 3 years ago
Maybe even put it under
NumOps
sinceMul + Add
is 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> {}
.
In generic code I would like
Float
bound to be enough to use it whereMulAdd
is expected given there isFloat::mul_add
, so trait can always be implemented. Maybe even put it underNumOps
sinceMul + Add
is enough to implement this trait, with fusion for types that support it and asa * b + c
for other types.