fork download
  1. import std.conv : to;
  2. import std.array : array;
  3. import std.algorithm : map;
  4. import std.stdio : writeln;
  5. import std.string : format, split;
  6.  
  7. void main() {
  8.  
  9. auto bitArr = format("%b", -15).split("").map!(to!ubyte).array;
  10.  
  11. writeln(bitArr);
  12. }
Success #stdin #stdout 0s 3768KB
stdin
Standard input is empty
stdout
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1]