You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Paulex Yang (JIRA)" <ji...@apache.org> on 2006/12/05 18:08:26 UTC

[jira] Updated: (HARMONY-2429) [classlib][math] java.math.BigDecimal(-0.0) returns wrong object

     [ http://issues.apache.org/jira/browse/HARMONY-2429?page=all ]

Paulex Yang updated HARMONY-2429:
---------------------------------

    Summary: [classlib][math] java.math.BigDecimal(-0.0) returns wrong object  (was: [math] java.math.BigDecimal(-0.0) returns wrong object)

> [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