Copyright | (c) Andrew Lelechenko, 2015 |
---|---|
License | GPL-3 |
Maintainer | andrew.lelechenko@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Convert an integer to digits and back. Usually this library is twice as fast as Data.Digits. For small bases and long numbers it may be up to 30 times faster.
Documentation
Return digits of a non-negative integer in reverse order. E. g.,
digits 10 123 = [3, 2, 1] digits 10 0 = []
Throw an error if number is negative or base is below 2.