Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: foo=${(z)${(s:.:)SECONDS}} ; echo ${foo[1]}.${(r:2:)foo[2]}



Peter Stephenson wrote:
> On Thu, 25 Oct 2007 16:37:03 +1300 (NZDT)
> Atom Smasher <atom@xxxxxxxxxxx> wrote:
> > from the man page...
> > 
> >  	For example, `typeset -F SECONDS' causes the value to be reported 
> > as a floating point number.  The precision is six decimal places, although 
> > not all places may be useful.
> 
> "Six" is wrong, ten is correct, but this is the wrong place to document it.
> I'll fix that.

Aargh.  OK.  The *precision*, in the sense that the floating point
number comes out with so many digits, is indeed 10.  However, the
*accuracy* is 6 digits.  That's because when it's floating point SECONDS
uses a microsecond timer.  That's what I should be saying in the manual.

>    typeset -F 2 SECONDS

is still the, er, right answer to the question you asked.

pws



Messages sorted by: Reverse Date, Date, Thread, Author