From maechler at stat.math.ethz.ch  Mon Jun  1 15:31:31 2009
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Mon, 1 Jun 2009 15:31:31 +0200
Subject: [Rd] as.numeric(levels(factor(x))) may be a decreasing sequence
In-Reply-To: <20090531082941.GA12517@cs.cas.cz>
References: <20090523074454.GA17112@cs.cas.cz>
	<18973.42970.826686.173830@cmath-5.math.ethz.ch>
	<4A1DC057.80401@idi.ntnu.no>
	<18975.59582.885300.549159@lynne.math.ethz.ch>
	<4A203D67.8000007@idi.ntnu.no>
	<3f1d2410905291448y271fa484te82b8dbaa547017f@mail.gmail.com>
	<4A20F97B.1090406@idi.ntnu.no>
	<18977.28100.532043.734122@cmath-4.math.ethz.ch>
	<20090531082941.GA12517@cs.cas.cz>
Message-ID: <18979.55347.718851.606502@cmath-5.math.ethz.ch>

>>>>> "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



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