On Tuesday, 24 March 2015 at 15:45:36 UTC, Dennis Ritchie wrote:
Tell me, please, how can I replace this code?
import std.conv : to;
import std.bigint : BigInt;
import std.string : format;
import std.stdio : writeln;
void main() {
BigInt[10] bitArr;
ulong n = 18_446_724_073_709_551_614U;
bitArr[0] = format("%b", n).to!BigInt;
writeln(bitArr[0]);
writeln(bitArr[0] ^ 1); // not work
}
Output:
1111111111111111111011011100111101100011000110101011111111111110
1111111111111111111011011100111101100011000110101011111111111111
Hi,
Well it works, the las bit is flip isn't it ? What are you trying
to achieve ?