title: BigDecimal compareTo not working as expected
body: <p>According to the <a href="http://download.oracle.com/javase/6/docs/api/java/math/BigDecimal.html#compareTo%28java.math.BigDecimal%29" rel="noreferrer">JavaDoc</a> for <code>BigDecimal</code>, the <code>compareTo</code> function does not account for the scale during comparison.</p>
  
  <p>Now I have a test case that looks something like this:</p>
  
  <pre><code>BigDecimal result = callSomeService(foo);
  assertTrue(result.compareTo(new BigDecimal(0.7)) == 0); //this does not work
  assertTrue(result.equals(new BigDecimal(0.7).setScale(10, BigDecimal.ROUND_HALF_UP))); //this works
  </code></pre>
  
  <p>The value I'm expecting the function to return is <code>0.7</code> and has a scale of 10. Printing the value shows me the expected result. But the <code>compareTo()</code> function doesn't seem to be working the way I think it should.</p>
  
  <p>What's going on here?</p>