[Rd] as.numeric(levels(factor(x))) may be a decreasing sequence

Martin Maechler maechler at stat.math.ethz.ch
Mon Jun 1 15:31:31 CEST 2009


>>>>> "PS" == Petr Savicky <savicky at cs.cas.cz>
>>>>>     on Sun, 31 May 2009 10:29:41 +0200 writes:

[............]

    PS> I appreciate the current version, which contains static
    PS> const char* dropTrailing0(char *s, char cdec) ...
    PS> mkChar(dropTrailing0((char *)EncodeReal(x, w, d, e,
    PS> OutDec), ...

    PS> Here, is better visible that the cast (char *) is used
    PS> than if it was hidden inside dropTrailing0(). Also, it
    PS> makes dropTrailing0() more consistent.

    PS> I would like to recall the already discussed
    PS> modification if (replace != p) while((*(replace++) =
    PS> *(p++))) ; which saves a few instructions in the more
    PS> frequent case that there are no trailing zeros.

Yes,  thank you.  This already was in my working version,
and I had managed to lose it again.
Will put i back

.... still hoping this topic would be closed now ...
Martin



More information about the R-devel mailing list