public class test{ public static void main(String[] args) { int m = 9; int n = m >> 3; int p = 8; int q=p <<2; System.out.println("m>>3 = "+ n); System.out.println("p<<3 = "+ q); } }
结果
m>>3 = 1 p<<3 = 32
左移n位,原来的数乘以2^n;右移n位,原来的数除以2^n,取整数部分
原文地址:https://www.cnblogs.com/thiaoqueen/p/8351105.html
时间: 2024-10-04 02:34:39