harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nellya Udovichenko (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2429) [classlib][math] java.math.BigDecimal(-0.0) returns wrong object
Date Wed, 07 Feb 2007 08:44:05 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-2429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470852
] 

Nellya Udovichenko commented on HARMONY-2429:
---------------------------------------------

Verified. Works fine. Thank you, Alexei!

> [classlib][math] java.math.BigDecimal(-0.0) returns wrong object
> ----------------------------------------------------------------
>
>                 Key: HARMONY-2429
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2429
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Artem Aliev
>         Assigned To: Alexei Zakharov
>         Attachments: HARMONY-2429-test.patch, HARMONY-2429.patch
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message