Copyright | © Frank Jung 2021 |
---|---|
License | GPL-3 |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Multiply
Description
Haskell implementations of multiplication algorithms as described by From Mathematics to Generic Programming.
Documentation
multiply3 :: Word -> Word -> Word Source #
Non-recursive version of Egyptian multiplication. Based on MathnStuff Egyptian multiplication.
multiply4 :: Word -> Word -> Word Source #
Non-recursive version of Egyptian multiplication by Rodrigo Girão Serrão
oddHalvesBinary :: Word -> [Word] Source #
Repeatadly half the given integer until 1 then replace even entries with 0 and odd entries with 1.