Logo

Programming-Idioms

History of Idiom 76 > diff from v27 to v28

Edit summary for version 28 by :

Version 27

2015-09-04, 08:46:09

Version 28

2015-09-04, 09:09:19

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
Integer.to_string(x, 2)
Code
Integer.to_string(x, 2)
Doc URL
http://elixir-lang.org/docs/v1.0/elixir/Integer.html#to_string/2
Doc URL
http://elixir-lang.org/docs/v1.0/elixir/Integer.html#to_string/2
Demo URL
http://play.elixirbyexample.com/s/b73b898ff9
Demo URL
http://play.elixirbyexample.com/s/d2e09a39c8