Programming-Idioms

History of Idiom 76 > diff from v13 to v14

Edit summary for version 14 :

Version 13

2015-08-21, 23:37:01

Version 14

2015-08-22, 14:58:55

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"

Imports
import std.conv;
Imports
import std.conv;
Code
auto s = to!string(13,2);
Code
auto s = to!string(13,2);
Comments bubble
using std.conv.to(int value, base)
Comments bubble
using std.conv.to(int value, base)
Doc URL
http://dlang.org/phobos/std_conv.html#.to
Demo URL
http://dpaste.dzfl.pl/e384473470a0
Demo URL
http://dpaste.dzfl.pl/e384473470a0