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

RE: a calculator for zsh - zcalc and pcal conflict


Thanks to kwong and Phil for the zcalc suggestions. I have implemented the
$@ in the input string and also the noglob/realias trick in my own .zshrc.
I'm pretty sure the settings are obvious so I won't post them here.

I don't know how "elegant" my "zcalc" is, but I get some round-off errors
with some float computations. For example:

+2403> zcalc 23.0 * 1.05                         ~ 31Fri203104
+2404> zsh --version                             ~ 31Fri203106
zsh 4.0.6 (i686-pc-cygwin)

+2403> echo $(( 23.0 * 1.05))                  ~ 31Fri205300 1
+2404> zsh --version                             ~ 31Fri205302
zsh 4.0.4 (i386-redhat-linux-gnu)

I have seen it where there isn't any round off error on my other machines at
work and at home. What is this? Anyway, not a big deal, just a little

Also, thanks to Peter S. for the heads up on the zsh-4.1.x dev branch. I
guess for my own sake I should rename this "zcalc" so I'll be forward
compatible. As far as I'm concerned, only 4.0.4 and 4.0.6 exist, because
those are the zsh versions on my personal and work computers (RedHat 7.3,
8.0, Cygwin 2003/1), so I didn't know about that. I look forward to a
release, but frankly, I think zsh-4.0.6 is pretty cool as is.

Anyway, I've been thinking more and more that zsh is becoming more and more
emacs-y, as in fully featured for the interactive use. GNU Emacs is an
"advanced, self-documenting, customizable, extensible real-time display
editor." zsh is an "advanced,
self-documenting, customizable, extensible real-time display CLI".

 < ^ ; ~,  Clifford Escobar CAOILE  (aka "Piyo-kun")
  (_  _,
   J~~>  _.___...:.__..__.: __.:_. .:_.__::_..:._::._...  _____ p(^_^)q

| -----Original Message-----
| From: Peter Stephenson [mailto:pws@xxxxxxx]
| Sent: Friday, January 31, 2003 02:34
| To: zsh-users@xxxxxxxxxx
| Subject: Re: a calculator for zsh - zcalc and pcal conflict
| kwong@xxxxxxxxxxxxxxxxxxxx wrote:
| > All,
| >
| > Earlier I posted a calculator "pcal" written in perl as
| > a followup to Clifford's post of "zcalc" written in zsh.
| >
| > Andy Spiegl noticed a problem and his email is attached
| > below.
| If you're worrying about conflicts, you might note there is already a
| `zcalc' supplied with the 4.1 zsh distribution.  It's a command-line
| interface rather than one-shot.  See the zshcontrib manual page.
| Yes, we still need to release 4.1, so you wouldn't know about this
| unless you're tracking the development version.
| --
| Peter Stephenson <pws@xxxxxxx>                  Software Engineer
| CSR Ltd., Science Park, Milton Road,
| Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070
| **********************************************************************
| The information transmitted is intended only for the person or
| entity to which it is addressed and may contain confidential
| and/or privileged material.
| Any review, retransmission, dissemination or other use of, or
| taking of any action in reliance upon, this information by
| persons or entities other than the intended recipient is
| prohibited.
| If you received this in error, please contact the sender and
| delete the material from any computer.
| **********************************************************************

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