[R] double precision

miller_2555 nabble.30.miller_2555 at spamgourmet.com
Wed Aug 19 21:28:13 CEST 2009

Duncan Murdoch-2 wrote:
> I believe the C99 standard doesn't require that a 64 bit signed integer 
> type exist (only one that is 64 bits or more), so that would likely 
> cause some headaches.  And we may still use some compilers that are not 
> C99 compliant, which may not have any type that big.
> But an even bigger problem is that there is a lot of type-specific code 
> in R.  Adding another primitive type like a 64 bit signed integer would 
> mean writing arithmetic routines for that type and deciding how it 
> interacts with all the other numeric types.  For example:  what if you 
> add a floating point double to a 64 bit int?  Normally adding a double 
> to an int coerces the result to double.  But double isn't big enough to 
> hold a 64 bit int exactly.  So doing something like x + 1 could lose 
> precision in x.
> So I imagine this will happen eventually, but it will not be easy, and 
> it probably won't happen soon.

Thanks for the quick response. I have not delved too deeply into the R
source to see how primitives are handled (I can certainly believe adding/
changing would be a significant chore, though). Mostly, I was curious as to
where this fell on the priority schedule. Admittedly, 64-bit integers are
certainly more of a convenience than a necessity. I sincerely appreciate all
the hard work put into a world class project such as this. 

View this message in context: http://www.nabble.com/-R--double-precision-tp7708057p25050447.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list