zsh-users
 help / color / mirror / code / Atom feed
From: unpingco@mpl.ucsd.edu (Jose Unpingco)
To: zsh-users@math.gatech.edu (zsh)
Subject: almost floating point...
Date: Fri, 15 Aug 1997 20:59:51 -0700 (PDT)	[thread overview]
Message-ID: <9708160359.AA24903@cryptica.UCSD.EDU> (raw)

hi,

I like to use the arithmetic abilities of zsh often and have noticed
that 

z=1;
echo $(( $z + 1/3*6  ))

doesn't add 2 to 1 =3. I think the intermediate divide operation
confuses things somehow since

z=1;
echo $(( $z + 6/3  ))

does add  2+1=3.  I was wondering  what the rules for  this are? Also,
are there any  compact alternatives if one needs to  do batch floating
point computations through the shell without using PERL or AWK. For
example,

foreach file (numbers*.txt)
  < $file | <compute floating point here somehow>
end

Thank you for your time and consideration.  
----------------------------------------------------------------------
        Jose Unpingco   Mail Code ECE 0407; WK# (619) 534-5904
----------------------------------------------------------------------


             reply	other threads:[~1997-08-16  4:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-16  3:59 Jose Unpingco [this message]
1997-08-16  6:58 ` Duncan Sargeant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9708160359.AA24903@cryptica.UCSD.EDU \
    --to=unpingco@mpl.ucsd.edu \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).