harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Kishenko (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1248) [classlib][math] exception compatibility BigDecimal.valueOf(0L, -22).shortValueExact()
Date Tue, 22 Aug 2006 06:53:13 GMT
[classlib][math] exception compatibility BigDecimal.valueOf(0L, -22).shortValueExact()

                 Key: HARMONY-1248
                 URL: http://issues.apache.org/jira/browse/HARMONY-1248
             Project: Harmony
          Issue Type: Bug
          Components: Non-bug differences from RI
            Reporter: Denis Kishenko

============= Spec ========================
public short shortValueExact()
  ArithmeticException - if this has a nonzero fractional part, or
will not fit in a short.

================ Test =========================
import java.math.BigDecimal;

public class Test {
  public static void main(String args[] ) {
      BigDecimal.valueOf(0L, -22).shortValueExact();

================ Output =====================
RI throws java.lang.ArithmeticException: Overflow
Harmony throws nothing, just return 0

Actually BigDecimal.valueOf(0L, -22) equals 0E+22. So Harmony follows
spec and looks absolutely logically.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message