From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21938 invoked by alias); 11 Jan 2015 17:33:45 -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: 34232 Received: (qmail 26453 invoked from network); 11 Jan 2015 17:33:30 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Originating-IP: [86.6.153.127] X-Spam: 0 X-Authority: v=2.1 cv=AoZg3YNP c=1 sm=1 tr=0 a=39NrsSuza2clQiZR/7fYWQ==:117 a=39NrsSuza2clQiZR/7fYWQ==:17 a=kj9zAlcOel0A:10 a=NLZqzBF-AAAA:8 a=q2GGsy2AAAAA:8 a=X9rblxtKj0PDuA4GzbEA:9 a=CjuIK1q_8ugA:10 Date: Sun, 11 Jan 2015 17:33:26 +0000 From: Peter Stephenson To: Subject: Re: Floating point modulus Message-ID: <20150111173326.0542bbff@ntlworld.com> In-Reply-To: <150110231017.ZM24021@torch.brasslantern.com> References: <1420807419-9270-1-git-send-email-mikachu@gmail.com> <54B013C5.6090307@eastlink.ca> <54B04A7A.1010402@eastlink.ca> <20150109223028.6e003bff@ntlworld.com> <54B066C5.3010008@eastlink.ca> <54B0D893.4080202@eastlink.ca> <510FB8E2-EA0C-4582-BD31-527E9755F0FB@larryv.me> <54B1ACA3.1050001@eastlink.ca> <150110175849.ZM21774@torch.brasslantern.com> <54B20E23.8090900@eastlink.ca> <150110231017.ZM24021@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 10 Jan 2015 23:10:17 -0800 Bart Schaefer wrote: > The following patch would instead silently substitute the fmod() call > when using the % operator on a float. Seems OK --- it avoids the very unusual implicit (at the shell rather than C level) cast from float back to integer. The only query is whether we need to test for HAVE_FMOD, though the manual page I can see suggests only the fmodf and fmodl variants we don't need are likely to be problematic. pws