Proposal: Add "fma" to the RealFloat class

Ken T Takusagawa kenta at mit.edu
Wed Apr 29 22:19:25 UTC 2015


On Wed, 29 Apr 2015, Edward Kmett wrote:

> Good point. If we wanted to we could push this all the way up to Num given the operations
> involved, and I could see that you could benefit from it there for types that have nothing
> to do with floating point, e.g. modular arithmetic could get away with using a single 'mod'.

I too advocate this go in Num.  The place I anticipate 
seeing fma being used is in some polymorphic linear algebra 
library, and it is not uncommon (having recently done this 
myself) to do linear algebra on things that aren't 
RealFloat, e.g., Rational, Complex, or number-theoretic 
fields.

--ken


More information about the Libraries mailing list