title: Float and BigDecimal precision difference
body: <pre><code>public static void main(String[] args) {
      // TODO Auto-generated method stub
      BigDecimal foo,foo1;
      foo=BigDecimal.valueOf(3.1);
      foo1=BigDecimal.valueOf(3.1f);
  
      System.out.println(foo);
      System.out.println(foo1);
  
  }
  </code></pre>
  
  <p>RESULT:<br />
  3.1<br />
  3.0999999046325684<br /><br />
  Why they are different result? I am using JDK1.7.0_03</p>