确定整数平方根是否为整数的最快方法
long
Math.sqrt()
31.5
63).
public final static boolean isPerfectSquare(long n){ if (n < 0) return false; long tst = (long)(Math.sqrt(n) + 0.5); return tst*tst == n;}
0.5
Math.sqrt()
Math.sqrt()
Math.sqrt()
.
or
switch
or
switch
.
or
if(lookup[(int)(n&0x3F)]) { test } else return false;
杨魅力