Logo

Programming-Idioms

History of Idiom 76 > diff from v7 to v8

Edit summary for version 8 by :

Version 7

2015-08-21, 14:06:53

Version 8

2015-08-21, 14:09:09

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 str = to!string(13,2);
Comments bubble
using std.conv.to(int value, radix)
Comments bubble
using std.conv.to(int value, base)
Demo URL
http://dpaste.dzfl.pl/e384473470a0
Demo URL
http://dpaste.dzfl.pl/e384473470a0