We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent add1817 commit 4766b9cCopy full SHA for 4766b9c
inst/include/Rcpp/internal/r_coerce.h
@@ -238,7 +238,8 @@ inline const char* coerce_to_string<REALSXP>(double x){
238
// so approximate it poorly as
239
static char tmp[128];
240
snprintf(tmp, 127, "%f", x);
241
- return dropTrailing0(tmp, '.');
+ if (strcmp( dropTrailing0(tmp, '.'), "-0") == 0) return "0";
242
+ else return dropTrailing0(tmp, '.');
243
}
244
#define NB 1000
245
template <>
0 commit comments