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

From: Martin Maechler <>
Date: Mon, 01 Jun 2009 15:31:31 +0200

>>>>> "PS" == Petr Savicky <>
>>>>> 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 mailing list Received on Mon 01 Jun 2009 - 13:34:14 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 01 Jun 2009 - 19:34:25 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive