*X-seq*: zsh-workers 34199*From*: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>*To*: Zsh hackers list <zsh-workers@xxxxxxx>*Subject*: Re: Math expression evaluation error?*Date*: Fri, 9 Jan 2015 16:25:08 -0800*In-reply-to*: <54B069A9.2040504@eastlink.ca>*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>

On Fri, Jan 9, 2015 at 3:52 PM, Ray Andrews <rayandrews@xxxxxxxxxxx> wrote: > It seems to me that if the > shell accepts the fractions then it should return the correct answer. I'd > make integer math the option and have accurate results as the default > but that's just me. 3/8 is not a fraction. Yes, in a text paragraph like this one I might write 3/8 as a fraction because I can't write a superscript three over a subscript eight, but in an arithmetic expression 0.375 is a fraction and 3/8 is "integer 3 divided by integer 8", and the definition of "divided by" includes "if both numerator and denominator are integers, then the result must also be an integer". As has been mentioned, this is the way a LOT of programming languages work.

**Follow-Ups**:**Re: Math expression evaluation error?***From:*Ray Andrews

**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

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