title: Difference of Two numbers - BigDecimal
body: <p>I am just trying to learn more about BigDecimal, but below code makes me confuse. </p>
  
  <pre><code>Double x = 1.2;
  String y = "1.2";
  
  BigDecimal a = BigDecimal.ZERO;
  BigDecimal b = BigDecimal.ZERO;
  
  a = new BigDecimal(x);
  b = new BigDecimal(y);
  
  int res = res = b.compareTo(a);
  
  if(res==1){
      System.out.println("Die");
  }else if(res ==0){
      System.out.println("Live");
  }else if (res==-1){
      System.out.println("God Loves you");
  }
  </code></pre>
  
  <blockquote>
    <p>Result = Die</p>
  </blockquote>
  
  <p>I am not ready to "<strong>Die</strong>", why BigDecimal is hell bent on killing me. </p>