Logo

Programming-Idioms

History of Idiom 76 > diff from v6 to v7

Edit summary for version 7 by :

Version 6

2015-08-21, 13:56:56

Version 7

2015-08-21, 14:06: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"

Imports
import std.conv;
Code
auto str = to!string(13,2);
Comments bubble
using std.conv.to(int value, radix)
Demo URL
http://dpaste.dzfl.pl/e384473470a0