JAVA,
分享于 点击 44535 次 点评:91
JAVA,
记录小数位数
DecimalFormat df = new DecimalFormat("#.0000");(表示保存四位的小数位数)
调用方法df.format(l);
对数l进行控位
应用Math.sqrt(a);
对a进行开平方根
public static int power(int n){
// if(n == 1)
// return 2;
// else
// return 2power(n-1);
int total = 2;
for(int i = 0;i<n-1;i++)
total = 2total;
return total;
}
相关文章
- 暂无相关文章
用户点评