Non-decimal radices/Output: Difference between revisions
m
→{{header|Haskell}}: (updated baseDigits function)
m (→{{header|Haskell}}: (added a further radix (32) to the test)) |
m (→{{header|Haskell}}: (updated baseDigits function)) |
||
Line 581:
tableRows :: [[String]]
tableRows = ((([
digits :: Array Int Char
digits = listArray (0, 35) (['0' .. '9'] <> ['A' .. 'Z'])
| otherwise = reverse . unfoldr remQuot
where
remQuot 0 =
remQuot n
let (q, r) = quotRem n
▲ in Just (digits ! r, q)
▲ else "Needs numeric glyphs beyond Z"
-- TEST AND TABULATION---------------------------------------------------------
|