Logo

Programming-Idioms

History of Idiom 76 > diff from v8 to v9

Edit summary for version 9 by :

Version 8

2015-08-21, 14:09:09

Version 9

2015-08-21, 14:09:39

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 str = 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)
Demo URL
http://dpaste.dzfl.pl/e384473470a0
Demo URL
http://dpaste.dzfl.pl/e384473470a0