On 07/03/2013 11:09 AM, Brian Burkhalter wrote:
On Jul 3, 2013, at 10:47 AM, Brian Burkhalter wrote:
I'll update this only to change the one public method and to modify its
specification.
I've updated the webrev
http://cr.openjdk.java.net/~bpb/6480539/
and rerun JTREG as well as modifying and resubmitting the CCC request (it had
been filed for the previous fix proposal).
The compareMagnitude method is private so shouldn't be used in the
behavioral description. I recommend something like, "If this {@code
BigDecimal} is numerically equal to zero, {@code BigDecimal.ZERO} is
returned."
Also, in the initial check, instead of
2604 if (compareMagnitude(BigDecimal.ZERO) == 0) {
2605 return BigDecimal.ZERO;
2606 } else if (intCompact != INFLATED) {
something like
if (intCompact == 0 or intVal.signum() == 0)
might be faster.
Also, I recommend adding a few more test cases for zeros with small
exponents, e.g. "0e2", "0e-2".
thanks,
-Joe