You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexei Zakharov (JIRA)" <ji...@apache.org> on 2007/02/06 15:36:06 UTC
[jira] Assigned: (HARMONY-2429) [classlib][math]
java.math.BigDecimal(-0.0) returns wrong object
[ https://issues.apache.org/jira/browse/HARMONY-2429?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexei Zakharov reassigned HARMONY-2429:
----------------------------------------
Assignee: Alexei Zakharov
> [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.