标签:enc ring var comment system tor value 对比 operator
//int转bigdecimal
?
BigDecimal number = new BigDecimal(0);
int value=score;
number=BigDecimal.valueOf(value);
//可以简化成
BigDecimal bigDecimal= BigDecimal.valueOf(1000);
?
//bigdecimal转int
?
BigDecimal b=new BigDecimal(45.66);
?
int a = b.intValue();
//前提为a、b均不能为null
if(a.compareTo(b) == -1){
System.out.println("a小于b");
}
if(a.compareTo(b) == 0){
System.out.println("a等于b");
}
if(a.compareTo(b) == 1){
System.out.println("a大于b");
}
if(a.compareTo(b) > -1){
System.out.println("a大于等于b");
}
if(a.compareTo(b) < 1){
System.out.println("a小于等于b");
}
标签:enc ring var comment system tor value 对比 operator
原文地址:https://www.cnblogs.com/yuanyou/p/14235407.html