Displaying 1 result from an estimated 1 matches for "myroundc".
Did you mean:
mround
2010 Mar 29
2
.Call and .C arguments
...in the debug mode in C the
value has changed to 1204.2449999999999999.
Is there a way to pass the arguments differently?
I'm using Windows and Visual Studio C++ 2005 Express Edition and
R-2.10.1.
Please see the two simple examples to understand the issue.
# C call from R
.C("myroundC",as.double(1204.245))
// C Code
void myroundC(double *Amount){
*Amount = Rf_fround(*Amount,2);
}
#Return value in R
[[1]]
[1] 1204.24
# C call from R
.Call("myroundCall",as.double(1204.245))
// C Code
SEXP myroundCall(SEXP a){
d...