commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Turner <>
Subject RE: Why not BigDecimal?
Date Fri, 12 Feb 2010 09:40:39 GMT
Interesting that this is a precision issue. I'm not surprised depending on what you are doing,
double precision may not be enough. It depends a lot on how the calculations are broken into
smaller parts. BigDecimal is fantastically useful...

-----Original Message-----
From: Ted Dunning [] 
Sent: 12 February 2010 05:59
To: Commons Users List
Subject: Re: Why not BigDecimal?

Doesn't R use doubles under the covers?  Note this quote from the manual:

*R has no single precision data type. All real numbers are stored in double
precision format*.


Any difference in the results that you saw is likely due to different
algorithms.  If you mean rank as in the rank of a matrix, then the exact
value is very much a matter of judgment since it involves an implicit
comparison of a numerical value to zero.  Using BigDecimal is very unlikely
to have significantly affected your results.

On Thu, Feb 11, 2010 at 9:29 PM, Something Something <> wrote:

> I wrote a simple program to run a Multiple Regression Analysis followed by
> Rank, and compared my results to those from R stats package and because of
> lack of precision the 'ranks' are way off.  I mean I am assuming that if we
> had used BigDecimal the ranks would have matched to the ones from R.
> Is there something I am missing?

Ted Dunning, CTO
View raw message