On 29 October 2018 at 12:43, Barth Riley wrote:
| Thanks, Dirk. Would it matter if I initialize the values in the array to 
missing (NA_REAL)?

I think you misunderstood my previous email (which you chose not to quote).

First:

  R> .Machine$integer.max
  [1] 2147483647
  R> 

Second:

  R> Rcpp::cppFunction("int addTwoInts(int a, int b) { return a+b; }")
  R> addTwoInts(2147483640L,5L)  # less than max
  [1] 2147483645
  R> addTwoInts(2147483640L,10L) # more than max
  [1] -2147483646
  R> 

You could trying using _double_ for your indices.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to