Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 50801 invoked from network); 19 Jun 2003 19:08:53 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 19 Jun 2003 19:08:53 -0000 Received: (qmail 4601 invoked by uid 97); 19 Jun 2003 19:11:16 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@nagoya.betaversion.org Received: (qmail 4594 invoked from network); 19 Jun 2003 19:11:16 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 19 Jun 2003 19:11:16 -0000 Received: (qmail 48168 invoked by uid 500); 19 Jun 2003 19:08:26 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 48057 invoked from network); 19 Jun 2003 19:08:25 -0000 Received: from mail.datazug.ch (212.4.65.100) by daedalus.apache.org with SMTP; 19 Jun 2003 19:08:25 -0000 Received: from yahoo.de [212.4.88.68] by mail.datazug.ch with ESMTP (SMTPD32-8.00) id AA32876202A8; Thu, 19 Jun 2003 21:08:34 +0200 Message-ID: <3EF20A2B.1080505@yahoo.de> Date: Thu, 19 Jun 2003 21:08:27 +0200 From: "J.Pietschmann" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030507 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Developers List Subject: Re: [math] Math.pow usage was: Re: cvs commit: ... References: <20030619150912.56514.qmail@web41710.mail.yahoo.com> <3EF1DE91.3070902@latte.harvard.edu> In-Reply-To: <3EF1DE91.3070902@latte.harvard.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Mark R. Diggory wrote: > (1) It is very important to also use ((double)x)*x instead of > (double)(x*x), as the loss of precision starts to occur at far greater > values than overflow occurs if one were doing integer arithmetic IIRC Java shares also the C behaviour in that n*n becomes negative instead of signalling an overflow. If this is embedded in a complicated expression you only notice strange results, or not even that. This can be quite hard to debug. I'm too lazy to run a test to confirm this right now, but I'm sure someone else will have done it when I wake up tomorrow :-) J.Pietschmann --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org