Bug 48825 - java.lang.Math.pow() broken in native JDK 1.3.1 patchset 8
Summary: java.lang.Math.pow() broken in native JDK 1.3.1 patchset 8
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Greg Lewis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-02 01:30 UTC by Milo Hyson
Modified: 2003-04-30 16:32 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milo Hyson 2003-03-02 01:30:13 UTC
Calling java.lang.Math.pow() under patchset 8 of the native 1.3.1 JDK yields incorrect results in certain cases. The following tests were performed:

2^10 = 0
2^5 = 0
2^1 = 2
2^0.5 = 1.414214
2^0 = 1
2^-0 = 1
2^-0.5 = 0
2^-1 = 0.5
2^-5 = 0
2^-10 = 0

-2^10 = 1024
-2^5 = -32
-2^1 = -2
-2^0.5 = NaN
-2^0 = 1
-2^-0 = 1
-2^-0.5 = NaN
-2^-1 = -0.5
-2^-5 = -0.03125
-2^-10 = 9.765625E-4

How-To-Repeat: Run the following code:

        public class TestPow
        {
                public static void main(String args[]) throws Exception
                {
                        System.out.println("Math.pow(2.0,10.0) = " + Math.pow(2.0,10.0));
                }
        }

It prints the following:

        Math.pow(2.0,10.0) = 0.0

It should print the following:

        Math.pow(2.0,10.0) = 1024.0
Comment 1 Tilman Keskinoz freebsd_committer freebsd_triage 2003-03-22 21:28:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->glewis

Over to Maintainer
Comment 2 Greg Lewis freebsd_committer freebsd_triage 2003-04-30 16:31:37 UTC
State Changed
From-To: open->closed

A patch has been committed.