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

Re: Rational numbers operation



On Wed, 16 Sep 2009 11:21:30 +0300
Grigorios Bouzakis <grbzks@xxxxxxxxxx> wrote:

> On Wed, Sep 16, 2009 at 10:12:12AM +0200, tartifola@xxxxxxxxx wrote:
> > 
> > 
> > Hi,
> > a newbie question on operations with rational numbers with the zshell.
> > If I try from the shell
> > 
> > >echo $((100.5 * 0.001 )) 
> > 
> > I got the correct result without any error. On the contrary if I try the same thing in script I get this error
> > 
> >  syntax error: invalid arithmetic operator (error token is ".5 * 0.001 ")
> > 
> > I'm sure I'm missing something very basic, any hints?
> > Thanks
> 
> You have to load zcalc. autoload -U zcalc

Thanks. 
I put 'autoload -U zcalc' in my .zshrc but nothing has changed. I
probably misunderstood your suggestion. How should I ask my script to
load zcalc?



> 
> -- 
> Greg




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