📜  如何在java代码示例中比较双打

📅  最后修改于: 2022-03-11 14:52:15.114000             🧑  作者: Mango

代码示例1
private static void testBdEquality() 
{
     BigDecimal a = new BigDecimal("2.00");
     BigDecimal b = new BigDecimal("2.0");
 
     System.out.println(a.equals(b));           // false
 
     System.out.println(a.compareTo(b) == 0);   // true
}