Math.DigitsVector
Description
Digits by Vector
Vector
toDigitsU :: Int -> Int -> Vector Int #
>>> toDigitsU 3 ((3^0)*1 + (3^1)*2 + (3^2)*1) [1,2,1]
>>>
toDigitsU 3 ((3^0)*1 + (3^1)*2 + (3^2)*1)
toNDigitsU :: Int -> Int -> Int -> Vector Int #
>>> toNDigitsU 3 3 ((3^0)*1 + (3^1)*0 + (3^2)*0) [1,0,0]
toNDigitsU 3 3 ((3^0)*1 + (3^1)*0 + (3^2)*0)
unDigitsU :: Int -> Vector Int -> Int #
>>> unDigitsU 3 (U.fromList [1,2,1]) == ((3^0)*1 + (3^1)*2 + (3^2)*1) True >>> unDigitsU 3 (toDigitsU 3 ((3^0)*1 + (3^1)*2 + (3^2)*1)) == ((3^0)*1 + (3^1)*2 + (3^2)*1) True
unDigitsU 3 (U.fromList [1,2,1]) == ((3^0)*1 + (3^1)*2 + (3^2)*1)
unDigitsU 3 (toDigitsU 3 ((3^0)*1 + (3^1)*2 + (3^2)*1)) == ((3^0)*1 + (3^1)*2 + (3^2)*1)