BigDecimal比较大小
BigDecimal decimal = new BigDecimal(0);
BigDecimal decima2 = new BigDecimal(2);
BigDecimal decima1 = new BigDecimal(2);
System.out.println("=========相等==========");
System.out.println(decima2.compareTo(decima1) == 0 );
System.out.println("=========小于==========");
System.out.println(decimal.compareTo(decima2) == -1);
System.out.println("=========
BigDecimal比较大小最先出现在Python成神之路。
共有 0 条评论