From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25607 invoked from network); 23 Sep 2001 15:47:20 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 23 Sep 2001 15:47:20 -0000 Received: (qmail 10881 invoked by alias); 23 Sep 2001 15:47:08 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4272 Received: (qmail 10858 invoked from network); 23 Sep 2001 15:47:07 -0000 Date: Sun, 23 Sep 2001 16:47:05 +0100 To: Clint Adams Cc: zsh-users@sunsite.dk Subject: Re: forcing output type Message-ID: <20010923164705.A15106@fysh.org> References: <20010923114054.A16301@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010923114054.A16301@dman.com> User-Agent: Mutt/1.3.20i From: Zefram Clint Adams wrote: >float f; (( f = 2/3 )); print $f > >to output the equivalent of what would be output >if, for instance, the "2" were replaced by "2.0"? The expression "2/3" is a truncating integer division; its value is exactly 0. Just as in C, if you want to do a floating-point division you have to provide floating-point operands. -zefram