From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 360 invoked from network); 31 Oct 2002 05:11:46 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 31 Oct 2002 05:11:46 -0000 Received: (qmail 7972 invoked by alias); 31 Oct 2002 05:11:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17885 Received: (qmail 7954 invoked from network); 31 Oct 2002 05:11:34 -0000 From: "Bart Schaefer" Message-Id: <1021031050931.ZM5514@candle.brasslantern.com> Date: Thu, 31 Oct 2002 05:09:31 +0000 In-Reply-To: <20021030211750.GA6296@scuzzy.blorf.net> Comments: In reply to Wayne Davison "PATCH: my "SECONDS can be floating point" tweaks" (Oct 30, 1:17pm) References: <22634.1035831352@csr.com> <20021030211750.GA6296@scuzzy.blorf.net> X-Mailer: Z-Mail (5.0.0 30July97) To: Zsh hackers list Subject: Re: PATCH: my "SECONDS can be floating point" tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 30, 1:17pm, Wayne Davison wrote: } Subject: PATCH: my "SECONDS can be floating point" tweaks } } I won't commit this until I get some positive feedback about the } changes. I think they look good, except (maybe) for one thing: } First, the intseconds{get,set}fn() functions are implemented by calling } the float* versions. Is converting to float and then back to integer (or the other way round for the setfn) really going to give the same results as a computation directly on only shtimer.tv_sec? I wouldn't want to lose or gain an entire second due to rounding errors when e.g. doing arithmetic in a loop on the integer SECONDS. (Is "rounding" the right description anyway? Isn't it _truncated_ to an integer when the parameter is not set to float?) I otherwise like the simplicity of this approach. } The second change may be more controversial. I introduced two new } functions that allow us to get and set the "raw" (non-relative to now) } value of the SECONDS variable (though the value is returned as a } double). I then added some code to builtin.c that saves this raw value } into the cached off u.dval, and changed the new code in params.c that } was adding local-elapsed time into the parent variable to just reload } the raw parent value. I must be sleepy or especially dense at the moment, but I don't follow what this means from the point of view of the _caller_ of a function in which SECONDS is local. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net