zsh-users
 help / color / mirror / code / Atom feed
* almost floating point...
@ 1997-08-16  3:59 Jose Unpingco
  1997-08-16  6:58 ` Duncan Sargeant
  0 siblings, 1 reply; 2+ messages in thread
From: Jose Unpingco @ 1997-08-16  3:59 UTC (permalink / raw)
  To: zsh

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
----------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-08-16  7:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-16  3:59 almost floating point Jose Unpingco
1997-08-16  6:58 ` Duncan Sargeant

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).