[Rcpp-commits] r3785 - in pkg/Rcpp: . inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Sep 30 23:59:50 CEST 2012


Author: edd
Date: 2012-09-30 23:59:50 +0200 (Sun, 30 Sep 2012)
New Revision: 3785

Modified:
   pkg/Rcpp/TODO
   pkg/Rcpp/inst/unitTests/runit.sugarOps.R
Log:
mark the misfeature for '+', '-' ops


Modified: pkg/Rcpp/TODO
===================================================================
--- pkg/Rcpp/TODO	2012-09-30 18:54:19 UTC (rev 3784)
+++ pkg/Rcpp/TODO	2012-09-30 21:59:50 UTC (rev 3785)
@@ -5,6 +5,8 @@
         eg Rcpp.package.skeleton("foo", list=c("funA", "funB")) ends
         in error.
 
+    o   Sugar ops unit tests on +, -, ... need double, fail with int
+
 Current inactive misfeatures
 
     o   Bugs found by Doug when using -ltcmalloc from the Google

Modified: pkg/Rcpp/inst/unitTests/runit.sugarOps.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.sugarOps.R	2012-09-30 18:54:19 UTC (rev 3784)
+++ pkg/Rcpp/inst/unitTests/runit.sugarOps.R	2012-09-30 21:59:50 UTC (rev 3785)
@@ -23,7 +23,7 @@
     	"vector_scalar_ops" = list(signature(x = "numeric"),
     			'
 			NumericVector xx(x);
-			NumericVector y1 = xx + 2.0;
+			NumericVector y1 = xx + 2.0;  // NB does not work with ints as eg '+ 2L'
 			NumericVector y2 = 2 - xx;
 			NumericVector y3 = xx * 2.0;
 			NumericVector y4 = 2.0 / xx;



More information about the Rcpp-commits mailing list