Find first and last set bit of a long integer: Difference between revisions
Find first and last set bit of a long integer (view source)
Revision as of 14:42, 26 March 2023
, 1 year ago→{{header|Java}}
Line 1,307:
System.out.print(String.format("%-7s%s%s", "1302 ^ ", i, " = "));
System.out.print(String.format("%1$" + 64 + "s", powerOf1302.toString(2)).replace(" ", "0"));
String line
System.out.println(line);
▲ String.format("%s%-2s%s%-2s", " -> LSB: ", LSB(powerOf1302), ", MSB: ", MSB(powerOf1302)));
powerOf1302 = powerOf1302.multiply(bigInteger1302);
}
|