commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent Worden" <>
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
( for their implementations.  Here's the pow
implementation  According to its
comments, its only perfectly accurate for the two integer argument case.
Otherwise it's "nearly rounded."

Brent Worden

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message