| 186 | const char* coerce_to_string( typename ::Rcpp::traits::storage_type<RTYPE>::type from ) ; |
| 187 | |
| 188 | inline const char* dropTrailing0(char *s, char cdec) { |
| 189 | /* Note that 's' is modified */ |
| 190 | char *p = s; |
| 191 | for (p = s; *p; p++) { |
| 192 | if(*p == cdec) { |
| 193 | char *replace = p++; |
| 194 | while ('0' <= *p && *p <= '9') |
| 195 | if(*(p++) != '0') |
| 196 | replace = p; |
| 197 | if(replace != p) |
| 198 | while((*(replace++) = *(p++))) ; |
| 199 | break; |
| 200 | } |
| 201 | } |
| 202 | return s; |
| 203 | } |
| 204 | |
| 205 | inline int integer_width( int n ){ |
| 206 | return n < 0 ? ( (int) ( ::log10( -n+0.5) + 2 ) ) : ( (int) ( ::log10( n+0.5) + 1 ) ) ; |
no outgoing calls
no test coverage detected