*X-seq*: zsh-workers 34214*From*: Ray Andrews <rayandrews@xxxxxxxxxxx>*To*: zsh-workers@xxxxxxx*Subject*: Re: Math expression evaluation error?*Date*: Sat, 10 Jan 2015 10:48:13 -0800*In-reply-to*: <150110085320.ZM28012@torch.brasslantern.com>*List-help*: <mailto:zsh-workers-help@zsh.org>*List-id*: Zsh Workers List <zsh-workers.zsh.org>*List-post*: <mailto:zsh-workers@zsh.org>*Mailing-list*: contact zsh-workers-help@xxxxxxx; run by ezmlm*References*: <54B03024.1030309@gmail.com> <20150109201552.1304eafe@ntlworld.com> <54B04ADA.9050102@gmail.com> <54B05407.7090303@eastlink.ca> <775A96D9-12A6-499B-8AAB-B2431F13701D@larryv.me> <54B069A9.2040504@eastlink.ca> <CAH+w=7Yq40Ksd-Y49hoBLexS+-o-CQHjtZ34k5zksY+g6W0=cg@mail.gmail.com> <54B0D451.1000502@eastlink.ca> <150110085320.ZM28012@torch.brasslantern.com>

On 01/10/2015 08:53 AM, Bart Schaefer wrote:

OK, let's leave zsh out of this and try the standard "expr" utility, which built-in arithmetic was designed to replace: % expr 3 / 8 0 % expr 3.0 / 8.0 expr: non-numeric argument

{ echo $(( 1/2 + 1/2 )); echo $(( .5 + .5 )); } 0 1

"

$ echo $(( ((.5 + 1/2) * 2) **2 4

$ setopt integer_arithmetic

" Just my personal opinion.

**Follow-Ups**:**Re: Math expression evaluation error?***From:*Bart Schaefer

**References**:**Math expression evaluation error?***From:*jdh

**Re: Math expression evaluation error?***From:*Peter Stephenson

**Re: Math expression evaluation error?***From:*jdh

**Re: Math expression evaluation error?***From:*Ray Andrews

**Re: Math expression evaluation error?***From:*Lawrence Velázquez

**Re: Math expression evaluation error?***From:*Ray Andrews

**Re: Math expression evaluation error?***From:*Bart Schaefer

**Re: Math expression evaluation error?***From:*Ray Andrews

**Re: Math expression evaluation error?***From:*Bart Schaefer

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