zsh-users
 help / color / mirror / code / Atom feed
From: Borsenkow Andrej <Andrej.Borsenkow@mow.siemens.ru>
To: "'Bruno Bonfils'" <asyd@debian-fr.org>,
	"'ZSH Users'" <zsh-users@sunsite.dk>
Subject: RE: question about float variables
Date: Wed, 10 Oct 2001 12:58:38 +0400	[thread overview]
Message-ID: <001401c15169$c095c020$21c9ca95@mow.siemens.ru> (raw)
In-Reply-To: <20011010013324.A9741@debian-fr.org>

> 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


  reply	other threads:[~2001-10-10  8:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-09 23:33 Bruno Bonfils
2001-10-10  8:58 ` Borsenkow Andrej [this message]
2001-10-10  9:42   ` Phil Pennock
2001-10-10 10:10     ` Borsenkow Andrej
2001-10-10 10:28       ` Phil Pennock
2001-10-10 12:47   ` Bruno Bonfils

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='001401c15169$c095c020$21c9ca95@mow.siemens.ru' \
    --to=andrej.borsenkow@mow.siemens.ru \
    --cc=asyd@debian-fr.org \
    --cc=zsh-users@sunsite.dk \
    /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).