From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15587 invoked by alias); 10 Jan 2015 00:25:23 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34199 Received: (qmail 18370 invoked from network); 10 Jan 2015 00:25:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=t2Egt+2QGYXoZjA7M3WiZn940Uz+kyCwcJlojK3QI0M=; b=IQ5X0BncOivf94zlNO0/uGwu5T8VTVq2IMd/RDAAPEpmILleCRLUOL61K4gKlD38tz WhUlYh6c6rEmrk8Up0S6/6LYt5PcnmPZ9MOabobsFnq0JRcA7n8+gCjykCBo5PKnhkMo 0x4w+X0Fh1uDnjzvJ/cnhEMXLu5lHv/aymBz68/QXD8NMflhCfvg4eqK7W++T8W6iYbE 7z5sqfeDt7u1qAOHyUy4h5MuXBoHFMZE/iTz54OrinP6mgxje+xwscoCoiLKiggLjwUt 6qHVhW8tS0fnTUD7stMgLmWi3y2RVJ7mM1GFUA8S6omtrBeuo4b04GqH8CT695yUigkI Hyzg== X-Gm-Message-State: ALoCoQmtlK4AKwFF7wS5mAqIjsFAeLDmDuyVwnxv3ZnCR3gwnIc70QZwoDIl56MJA+V/QzAIPwNx MIME-Version: 1.0 X-Received: by 10.180.75.199 with SMTP id e7mr9699630wiw.21.1420849508816; Fri, 09 Jan 2015 16:25:08 -0800 (PST) In-Reply-To: <54B069A9.2040504@eastlink.ca> 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> Date: Fri, 9 Jan 2015 16:25:08 -0800 Message-ID: Subject: Re: Math expression evaluation error? From: Bart Schaefer To: Zsh hackers list Content-Type: text/plain; charset=UTF-8 On Fri, Jan 9, 2015 at 3:52 PM, Ray Andrews 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.