[Rcpp-commits] r3282 - pkg/int64/inst/include/int64
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Nov 4 19:57:17 CET 2011
Author: romain
Date: 2011-11-04 19:57:17 +0100 (Fri, 04 Nov 2011)
New Revision: 3282
Modified:
pkg/int64/inst/include/int64/as_long.h
Log:
allowing as.int64( [double] )
Modified: pkg/int64/inst/include/int64/as_long.h
===================================================================
--- pkg/int64/inst/include/int64/as_long.h 2011-11-04 18:42:38 UTC (rev 3281)
+++ pkg/int64/inst/include/int64/as_long.h 2011-11-04 18:57:17 UTC (rev 3282)
@@ -58,7 +58,16 @@
data.set( i, tmp ) ;
}
break;
- }
+ }
+ case REALSXP:
+ {
+ double* pd_x = REAL(x) ;
+ for( int i=0;i<n; i++){
+ LONG tmp = pd_x[i] ;
+ data.set( i, tmp ) ;
+ }
+ break;
+ }
default:
Rf_error( "incompatible type" ) ;
}
More information about the Rcpp-commits
mailing list