You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tony Wu (JIRA)" <ji...@apache.org> on 2006/12/14 11:39:22 UTC
[jira] Commented: (HARMONY-2429) [classlib][math]
java.math.BigDecimal(-0.0) returns wrong object
[ http://issues.apache.org/jira/browse/HARMONY-2429?page=comments#action_12458420 ]
Tony Wu commented on HARMONY-2429:
----------------------------------
The testcase aforementioned passed on my machine with classlib r484851.
> [classlib][math] java.math.BigDecimal(-0.0) returns wrong object
> ----------------------------------------------------------------
>
> Key: HARMONY-2429
> URL: http://issues.apache.org/jira/browse/HARMONY-2429
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Artem Aliev
>
> java.math.BigDecimal(-0.0) returns wrong object.
> As result Math.pow(10, obj.scale()) returns Infinity while RI returns 1.0.
> Test for reproducing:
> import junit.framework.TestCase;
> import java.math.*;
> public class test extends TestCase {
> public void test1 () {
> try {
> double val=-0.0;
> BigDecimal obj = new BigDecimal(val);
> System.out.println("BigDecimal(-0.0)"+ obj);
> System.out.println( "scale="+obj.scale());
> System.out.println( Math.pow(10, obj.scale()));
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> Output on Sun 1.5
> =================
> .BigDecimal(-0.0)0
> scale=0
> 1.0
> Time: 0,015
> OK (1 test)
> Output on Harmony:
> ==================
> .BigDecimal(-0.0)0E-1011
> scale=1011
> Infinity
> Time: 0.031
> OK (1 test)
--
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