- 依次打印long类型数字各位上的数:
private void longPrint(){
long Xmask = 212321323144L;
long sum = Xmask;
long total = 0L;
long current = 0L;
for(int index = 1; index < 13; index++){
total = sum;
sum = sum / 10;
current = total - sum * 10;
Log.d(TAG, "@justinTest current: " + current);
}
for(int index = 0, count = 13; index < 12; index++, count--){
long currentValue = Xmask / (long)(Math.pow(10, count-2));
Xmask = Xmask - currentValue * (long)(Math.pow(10, count-2));
Log.d(TAG, "@justinTest currentValue:"+currentValue+" Xmask: " + Xmask);
}
}