一个32位整数二进制包含了多少个1
摘要:public static int countBinNum2(int num){ /* * 改进了算法 * 因为补码加上原码==pow(2,这个数的绝对值所换算成二进制的位数) * 利用负数所表示例如-5 == 1111 1111 1111 1111 1111 1111 1111 1111(0xff
阅读全文
posted @ 2019-08-25 21:35
posted @ 2019-08-25 21:35
posted @ 2019-08-25 21:29
posted @ 2019-08-25 21:05
posted @ 2019-08-25 16:35