Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: question about float variables



On 2001-10-10 at 14:10 +0400, Borsenkow Andrej wrote:
> - multiply by 1.0: $((var1*1.0/var2))
> - use temps
> - use float() function: $((float(var1)/var2))
> 
> What is wrong with above?

Nothing -- if you take the time to _read_ the mail to which you're
replying, before launching into a tirade, you might notice that I
actually pointed to "zmodload math/compfunc" and then using the float()
function.  I wasn't saying that zsh is not useful.

> BTW how is it different from C? 

What has this got to do with it?  Is C an exemplar of good design, now?

> > I've not seen a way in zsh to modify this to be 'sensible' for humans,
> 
> If you can suggest how to 'sensibly' incorporate it into zsh grammar ...

Yet Another typeset flag.  There are already flags handling how
parameters are displayed, alignment, etc etc.  One to say "display this
param as though using %g".

> > Personally, I'd use the OS's printf(1) if it exists,

> It is included into 4.1 branch.

Cool. :^)
-- 
Across all scientific fields, skeptical analysis of technical claims made by
others, and the presentation of detailed evidence to support such analysis, is
the heart of the scientific method. To outlaw such analysis is to outlaw the
scientific method itself. -- Ed Felten; declaration in Felten v RIAA 2001-08-13

Attachment: pgpaHSYTR7xTj.pgp
Description: PGP signature



Messages sorted by: Reverse Date, Date, Thread, Author