Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
almost floating point...
- X-seq: zsh-users 973
- From: unpingco@xxxxxxxxxxxx (Jose Unpingco)
- To: zsh-users@xxxxxxxxxxxxxxx (zsh)
- Subject: almost floating point...
- Date: Fri, 15 Aug 1997 20:59:51 -0700 (PDT)
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
----------------------------------------------------------------------
Messages sorted by:
Reverse Date,
Date,
Thread,
Author