From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2411 invoked from network); 10 Oct 2001 08:59:04 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 10 Oct 2001 08:59:04 -0000 Received: (qmail 19951 invoked by alias); 10 Oct 2001 08:58:50 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4361 Received: (qmail 19922 invoked from network); 10 Oct 2001 08:58:46 -0000 From: Borsenkow Andrej To: "'Bruno Bonfils'" , "'ZSH Users'" Subject: RE: question about float variables Date: Wed, 10 Oct 2001 12:58:38 +0400 Message-ID: <001401c15169$c095c020$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: <20011010013324.A9741@debian-fr.org> Importance: Normal > float var1=0.0 > var1=$((3 / 2)) > echo $var1 > > return 1.000000000e+00 not good ! :( > bor@itsrm2% float var1 bor@itsrm2% var1=$((3.0/2)) bor@itsrm2% print $var1 1.500000000e+00 Integer divided by integer is integer. > and how to format the output of $var1 ? > (i want a number like 95.3) > Should I just say RTFM? typeset description: -E Use an internal double-precision floating point representation. On output the variable will be converted to scientific notation. If N is nonzero it defines the number of significant figures to display; the default is ten. -F Use an internal double-precision floating point representation. On output the variable will be converted to fixed-point decimal notation. If N is nonzero it defines the number of digits to display after the decimal point; the default is ten. -andrej