commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent Worden" <br...@worden.org>
Subject RE: [math] Math.pow usage was: Re: cvs commit: ...
Date Thu, 19 Jun 2003 05:14:25 GMT
>
> I am also a little confused by J's analysis. Do we know
> definitively that using
> J2SE, there is precision loss in Math.pow(x,n) vs x*x*...*x (n
> terms) for small
> integer n?  If the answer is yes, we should establish the
> guideline that for
> integer n < 4, we use explicit products instead of Math.pow(-,n).
>
> Phil

According to the J2SE javadoc, the math methods use fdlibm
(http://www.netlib.org/fdlibm/) for their implementations.  Here's the pow
implementation http://www.netlib.org/fdlibm/e_pow.c.  According to its
comments, its only perfectly accurate for the two integer argument case.
Otherwise it's "nearly rounded."

Brent Worden
http://www.brent.worden.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message