metaclass (metaclass) wrote,
metaclass
metaclass

0.0000<>0.00

BigDecimal d1 = new BigDecimal(new BigInteger("0"),2);
BigDecimal d2 = new BigDecimal(new BigInteger("0"),4);
System.out.println(d1);
System.out.println(d2);
System.out.println(d2.equals(d1)); //<-- WTF?

PS: System.out.println(d2.compareTo(d1)==0); //ок
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 138 comments