From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18258 invoked by alias); 14 May 2015 09:53:58 -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: 35122 Received: (qmail 20045 invoked from network); 14 May 2015 09:53:56 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f5-f794b6d000001495-18-555470b02147 Date: Thu, 14 May 2015 10:53:49 +0100 From: Peter Stephenson To: Emanuel Berg , zsh-workers@zsh.org Subject: Re: why do ceil/floor give the decimal dot? Message-id: <20150514105349.52338d94@pwslap01u.europe.root.pri> In-reply-to: References: <87oalodmns.fsf@debian.uxu> <150513195617.ZM29493@torch.brasslantern.com> <87d223et0a.fsf@debian.uxu> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHLMWRmVeSWpSXmKPExsVy+t/xy7obCkJCDa6eVLbYfCnV4mDzQyYH Jo/+1qmsHqsOfmAKYIrisklJzcksSy3St0vgyljdtpGl4BBzxfkbK5kaGF8ydTFyckgImEg8 m/uEGcIWk7hwbz1bFyMXh5DAUkaJXU+amCGcBiaJFZfXsUM42xgl3rSfZQVpYRFQlfjTd4Ed xGYTMJSYumk2I4gtImAn8aVjN9gKYaAVx1oXgK3gFbCXWHj7PFgNp4CtxIkbz5gghi5jlJjw 4QJYA7+AvsTVv5+g7rOXmHnlDCNEs6DEj8n3WEBsZgF1iUnzFjFD2NoST95dADtICCh+4+5u 9gmMQrOQtMxC0jILScsCRuZVjKKppckFxUnpuUZ6xYm5xaV56XrJ+bmbGCGh/HUH49JjVocY BTgYlXh4OQyDQ4VYE8uKK3MPMUpwMCuJ8K6PDgkV4k1JrKxKLcqPLyrNSS0+xCjNwaIkzjtz 1/sQIYH0xJLU7NTUgtQimCwTB6dUA+Pc70sKeVo/vFr6z1mKWSnD6M6V5pYHu3c02XXE8rek dPMt+Pnp3QOvKTnrk4ufT/fMWDjntXtb2ZTVttm79+u3ef64WrOne29HtdDpSdO8u29bn9XT 7L5ceEFlo3tifIgGH0vDTNkMU15xl+SKvsoVqadmJJedb70j1PLm7I0XP/bMM9YzrlBiKc5I NNRiLipOBACYrFtXYQIAAA== On Wed, 13 May 2015 23:53:53 -0400 Lawrence Vel=C3=A1zquez wrote: > - "ceil(log(30)/log(2))" returns floating-point "5." ... as noted, this is down to the C math library function returning floating point. It has to do this because it doesn't know the result fits in an integer --- ceil(5e30) is a perfectly valid calculation. See the manual page. So if you're happy it does fit, just convert to integer yourself. pws