System.out.println(new BigDecimal("1.2").equals(new BigDecimal("1.20"))); //输出false
System.out.println(new BigDecimal("1.2").compareTo(new BigDecimal("1.20")) == 0); //输出true
时间: 2024-11-03 05:32:08
System.out.println(new BigDecimal("1.2").equals(new BigDecimal("1.20"))); //输出false
System.out.println(new BigDecimal("1.2").compareTo(new BigDecimal("1.20")) == 0); //输出true