Logo

Programming-Idioms

History of Idiom 76 > diff from v63 to v64

Edit summary for version 64 by programming-idioms.org:
[D] DPaste has been down for a while ✝

Version 63

2020-04-28, 22:27:43

Version 64

2020-05-21, 22:06:51

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"

Variables
s,x
Extra Keywords
int radix
Extra Keywords
int radix
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
Doc URL
http://dlang.org/phobos/std_conv.html#.to
Demo URL
http://dpaste.dzfl.pl/e384473470a0