public static void main(String[] agrs) throws Exception {
int low=2;
int high=2;
//System.out.println((high-low)>>1);
int mid=low+((high-low)>>1);
int mid1=low+(high-low)>>1;
System.out.println(mid);
System.out.println(mid1);
}
}
运算结果:
2
1
对于不确定的运算符优先级可以用括号来解决