bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [minor] "precision" of $SECONDS


From: Chet Ramey
Subject: Re: [minor] "precision" of $SECONDS
Date: Fri, 26 Feb 2016 09:40:55 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 2/25/16 12:20 PM, Stephane Chazelas wrote:
> 2016-02-25 10:48:51 -0500, Chet Ramey:
> [...]
>> Because bash doesn't have floating point arithmetic.
> 
> Yes, makes sense. mksh having $EPOCHREALTIME floating point even
> though it doesn't have floating point arithmetic does sound
> weird.
> 
> Any plan of adding floating point arithmetic support to bash by
> the way?

It's not on the short-term feature list.


>> Bash's %T implementation doesn't have %N because it uses the libc
>> strftime(3), and as far as I know, no strftime provides it.  I assume
>> that ksh93 implements it internally as part of libast.
> [...]
> 
> Probably. Note that GNU date also has a %N and doesn't use
> strftime either. strftime taking a struct tm can't have
> subseconds anyway.

GNU date uses its own time-string-formatting function, derived from
strftime and extended to include things like %N.

Bash includes Aharon Robbins's open-source strftime for those systems
that don't have it; I suppose I could extend that and use it
unconditionally.


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]