planet-mitchell-0.1.0: Planet Mitchell

Safe HaskellNone
LanguageHaskell2010

Num.Integer.Partial

Synopsis

Documentation

digits #

Arguments

:: Int

The base to use

-> Integer

The number to convert

-> [Int]

Digits in reverse order

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   = []

undigits #

Arguments

:: (Integral a, Integral b) 
=> a

The base to use

-> [b]

The list of digits to convert

-> Integer 

Return an integer, built from given digits in reverse order. Condition 0 ≤ digit < base is not checked.