Logo

Programming-Idioms

History of Idiom 76 > diff from v23 to v24

Edit summary for version 24 by :

Version 23

2015-08-31, 11:23:52

Version 24

2015-09-03, 15:04:53

Idiom #76 Binary digits from an integer

Create the string s of integer x written in base 2.

E.g. 13 -> "1101"

Idiom #76 Binary digits from an integer

Create the string s of integer x written in base 2.

E.g. 13 -> "1101"

Code
s x = Numeric.showIntAtBase 2 Data.Char.intToDigit x ""