Jump to content

Non-decimal radices/Convert: Difference between revisions

→‎{{header|Haskell}}: + Devanagari and HinduArabic digits
(→‎{{header|Haskell}}: (change order of functions to match order of description in preamble))
(→‎{{header|Haskell}}: + Devanagari and HinduArabic digits)
Line 1,297:
inOctal :: Int -> String
inOctal = inBaseDigits "01234567"
 
inDevanagariDecimal :: Int -> String
inDevanagariDecimal = inBaseDigits "०१२३४५६७८९"
 
inHinduArabicDecimal :: Int -> String
inHinduArabicDecimal = inBaseDigits "٠١٢٣٤٥٦٧٨٩"
 
toBase :: Int -> Int -> String
Line 1,307 ⟶ 1,313:
main =
mapM_ putStrLn $
[ inLowerHex
[inLowerHex, inUpperHex, inBinary, inOctal, toBase 16, toBase 2] <*> [254]</lang>
, inUpperHex
, inBinary
, inOctal
, toBase 16
, toBase 2
, inDevanagariDecimal
, inHinduArabicDecimal
] <*>
[254]</lang>
 
{{Out}}
Line 1,315 ⟶ 1,330:
376
fe
11111110</pre>
२५४
٢٥٤</pre>
 
=={{header|HicEst}}==
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.