Non-decimal radices/Convert: Difference between revisions

Content added Content deleted
(→‎{{header|Haskell}}: Generalising to allow for variant digit sets, such as upper case vs lower case Hexadecimal)
m (→‎{{header|Haskell}}: (adjusted the example))
Line 1,293: Line 1,293:
inOctal :: Int -> String
inOctal :: Int -> String
inOctal = inBaseDigits "01234567"
inOctal = inBaseDigits "01234567"



main :: IO ()
main :: IO ()
main =
main = mapM_ putStrLn $ [inLowerHex, inUpperHex, inBinary, inOctal] <*> [255]</lang>
mapM_ putStrLn $ [inLowerHex, inUpperHex, inBinary, inOctal] <*> [254]</lang>


{{Out}}
{{Out}}
<pre>ff
<pre>fe
FE
FF
11111110
11111111
377</pre>
376</pre>


=={{header|HicEst}}==
=={{header|HicEst}}==