From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: Inconsistency: sometimes an integer, sometimes a float Date: Thu, 23 Jan 2014 22:42:06 +0100 Organization: Informatimago Message-ID: <87ppnijryp.fsf@kuiper.lan.informatimago.com> References: <4ce73e74-a069-4e8d-b606-5aa76b848940@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1390513428 4403 80.91.229.3 (23 Jan 2014 21:43:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jan 2014 21:43:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 23 22:43:56 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W6S43-0002hy-5Q for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Jan 2014 22:43:55 +0100 Original-Received: from localhost ([::1]:43330 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6S42-00075l-R9 for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Jan 2014 16:43:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6S3l-00075Z-Ck for help-gnu-emacs@gnu.org; Thu, 23 Jan 2014 16:43:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6S3e-0008WH-Av for help-gnu-emacs@gnu.org; Thu, 23 Jan 2014 16:43:37 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:33001) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6S3e-0008VB-3h for help-gnu-emacs@gnu.org; Thu, 23 Jan 2014 16:43:30 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W6S3c-0002Xd-0h for help-gnu-emacs@gnu.org; Thu, 23 Jan 2014 22:43:28 +0100 Original-Received: from amontsouris-651-1-109-141.w83-202.abo.wanadoo.fr ([83.202.224.141]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 23 Jan 2014 22:43:28 +0100 Original-Received: from pjb by amontsouris-651-1-109-141.w83-202.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 23 Jan 2014 22:43:28 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 30 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: amontsouris-651-1-109-141.w83-202.abo.wanadoo.fr Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:YzQ1NDc5YWFmZmRhNzIwZTBlOTRhZDI1MGI4MzE4YmE1ZTA2YzA2MA== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95594 Archived-At: djc writes: > "(/ 536870911 1000000)" is an integer. > > "(/ 536870912 1000000)" is a float. > > I know why, but it's still unpleasant to have to program around it. I suppose this begs the question of when there will be a supported 64-bit release of Emacs. > > GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) A 64-bit emacs wouldn't be a solution, you'd just increase the number of cases where (/ (1+ n) p) is not of the same type as (/ n p).n Instead, write: (defun float/ (dividend divisor &rest divisors) (apply (function /) (float dividend) divisor divisors)) and use it instead of /. (float/ 536870911 1000000) --> 536.870911 (float/ 536870912 1000000) --> 536.870912 (float/ 536870.912 1000.000) --> 536.870912 -- __Pascal Bourguignon__ http://www.informatimago.com/ "Le mercure monte ? C'est le moment d'acheter !"