Copyright | (c) Andrew Lelechenko 2015-2020 |
---|---|
License | GPL-3 |
Maintainer | [email protected] |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Data.FastDigits
Description
Convert an integer to digits and back. This library is both asymptotically (O(n^1.4) vs. O(n^2)) and practically (2x-40x for typical inputs) faster than Data.Digits.
Documentation
Return digits of a non-negative number in reverse order. Throw an error if number is negative or base is below 2.
digits 10 123 = [3, 2, 1] digits 10 0 = []