Re: calculate time span
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: calculate time span

From: Lisa Pearlson <no@spam.plz>
Date: Wed Mar 01 2006 - 01:09:07 CET

Thanks,

Otherwise, anything wrong with my code?
Isn't it useful enough to be included in the clock command or seperate
package?

Lisa
P.S. How many years can be expressed in the internal datatype used to keep
track of the number of seconds?

"Glenn Jackman" <xx087@freenet.carleton.ca> wrote in message
news:slrne06ss0.fhh.xx087@smeagol.ncf.ca...
> At 2006-02-27 03:18PM, Lisa Pearlson <no@spam.plz> wrote:
>> proc wholeunits {val} {
>> return [expr {[format {%.0f} [expr { ($val < 0) ? ceil($val) :
>> floor($val) }]]}]
>> }
>
> You don't need nested [expr] statements:
>
> proc wholeunits {val} {
> return [expr {int( ($val < 0) ? ceil($val) : floor($val) )}]
> }
>
> --
> Glenn Jackman
> Ulterior Designer
Received on Sun Apr 30 02:18:07 2006