title: BigDecimal#compareTo with different scales
body: <p>Why does the following return <code>1</code>?</p>
  
  <pre><code>new BigDecimal(0.82).setScale(5, BigDecimal.ROUND_HALF_DOWN)
      .compareTo(new BigDecimal(0.82))
  </code></pre>
  
  <p>I expect this to return <code>0</code> because <code>BigDecimal.compareTo</code> <strong>ignores scale</strong> according to its <a href="https://docs.oracle.com/javase/10/docs/api/java/math/BigDecimal.html#compareTo(java.math.BigDecimal)" rel="nofollow noreferrer">documentation</a>:</p>
  
  <blockquote>
    <p>Compares this <code>BigDecimal</code> with the specified <code>BigDecimal</code>. Two <code>BigDecimal</code> objects that are <strong>equal</strong> in value but have a <strong>different scale</strong> (like <code>2.0</code> and <code>2.00</code>) are <strong>considered equal by this method</strong>. [...]</p>
  </blockquote>