From owner-freebsd-java Sat Feb 15 1:54: 0 2003 Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 022EB37B401 for ; Sat, 15 Feb 2003 01:53:59 -0800 (PST) Received: from relay1.cris.net (relay1.cris.net [212.110.128.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3351243F3F for ; Sat, 15 Feb 2003 01:53:56 -0800 (PST) (envelope-from ml@phantom.cris.net) Received: from phantom.cris.net (root@phantom.cris.net [212.110.130.74]) by relay1.cris.net (8.12.6/8.12.6) with ESMTP id h1FBxvvb024527; Sat, 15 Feb 2003 11:59:58 GMT Received: (from ml@localhost) by phantom.cris.net (8.12.6/8.12.2) id h1FA0PAK019197; Sat, 15 Feb 2003 12:00:25 +0200 (EET) (envelope-from ml) Date: Sat, 15 Feb 2003 12:00:25 +0200 From: Alexey Zelkin To: shudo@computer.org Cc: java@FreeBSD.ORG Subject: Re: Math.pow bug for jdk1.3.1-p8 ? Message-ID: <20030215120025.A19152@phantom.cris.net> References: <3E4C9DDD.4040204@gddsn.org.cn> <20030215.175421.1015281127.shudo@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20030215.175421.1015281127.shudo@localhost>; from shudo@computer.org on Sat, Feb 15, 2003 at 05:54:21PM +0900 X-Operating-System: FreeBSD 4.7-STABLE i386 Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org hi, I'd suggest looking in fdlibm's include named 'jfdlibm.h' I did not look at 1.3.1-p8 yet, but __j__* functions are handled there. On Sat, Feb 15, 2003 at 05:54:21PM +0900, shudo@computer.org wrote: > Hi guys who love hairsplitting (including me, and this is certainly an > important problem), > > From: Huang wen hui > > > I build jdk1.3.1-p8 for 4.7-STABLE(today), Math.pow return wrong value > > if using the following example: > > > > public class TestPow { > > public static void main(String[] args) { > > int exp =9; > > int i = (int)Math.pow(2.0,(double)exp); > > System.out.println("i="+i); > > } > > } > > > > ----------output------------ > > %java TestPow > > i=0 > > > I could reproduce your problem with JDK 1.3.1p8 and gcc 2.95.4 on > recent 4.7-STABLE. > > > % java -version > java version "1.3.1-p8" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-p8-root-030213-11:48) > Classic VM (build 1.3.1-p8-root-030213-11:48, green threads, nojit) > % gcc -v > Using builtin specs. > gcc version 2.95.4 20020320 [FreeBSD] > % uname -a > FreeBSD dv1.a02.aist.go.jp 4.7-STABLE FreeBSD 4.7-STABLE #0: Thu Feb 13 20:58:55 JST 2003 root@dv1.a02.aist.go.jp:/usr/src/sys/compile/MEBIUS140H i386 > > > I could confirm __j__ieee754_pow() in libjava.so behaves wrong and one > in libjava_g.so works correctly. > > I also tried writing a test program which calls __j__ieee754_pow() and > linked the program with e_pow.o, w_sqrt.o, e_sqrt.o, s_fabs.o, > s_scalbn.o and s_copysign.o generated during compilation process of > JDK 1.3.1. The program produces the incorrect value (0, not 512). > > It is certain that there is a problem around fdlibm, FreeBSD's gcc > 2.95.4 or how the fdlibm compiled (compiler flags?). > > > Kazuyuki Shudo shudo@computer.org http://www.shudo.net/ > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-java" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message