Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: forcing output type
- X-seq: zsh-users 4272
- From: Zefram <zefram@xxxxxxxx>
- To: Clint Adams <clint@xxxxxxx>
- Subject: Re: forcing output type
- Date: Sun, 23 Sep 2001 16:47:05 +0100
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <20010923114054.A16301@xxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20010923114054.A16301@xxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author