Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Mar 2003 17:25:27 -0800 (PST)
From:      Milo Hyson <milo@cyberlifelabs.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/48825: java.lang.Math.pow() broken in native JDK 1.3.1 patchset 8
Message-ID:  <200303020125.h221PRI5040399@unit0.iddb.cyberlifelabs.com>

next in thread | raw e-mail | index | archive | help

>Number:         48825
>Category:       ports
>Synopsis:       java.lang.Math.pow() broken in native JDK 1.3.1 patchset 8
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 01 17:30:13 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Milo Hyson
>Release:        FreeBSD 4.5-RELEASE i386
>Organization:
CyberLife Labs, LLC
>Environment:
System: FreeBSD unit0.iddb.cyberlifelabs.com 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Wed Oct 23 13:39:42 PDT 2002 root@unit0.iddb.cyberlifelabs.com:/usr/src/sys/compile/IDDB-20021023 i386


	
>Description:
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

>Fix:

	


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303020125.h221PRI5040399>