From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: macro FIXNUM_OVERFLOW_P in lisp.h is valid ? Date: Sat, 24 Oct 2009 11:05:17 +0200 Message-ID: <83vdi5f9gy.fsf@gnu.org> References: <83y6n1gb14.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1256375643 18710 80.91.229.12 (24 Oct 2009 09:14:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Oct 2009 09:14:03 +0000 (UTC) Cc: emacs-devel@gnu.org To: Toru TSUNEYOSHI Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 24 11:13:55 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N1ch9-0003N9-62 for ged-emacs-devel@m.gmane.org; Sat, 24 Oct 2009 11:13:55 +0200 Original-Received: from localhost ([127.0.0.1]:53120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1ch8-0002rm-EW for ged-emacs-devel@m.gmane.org; Sat, 24 Oct 2009 05:13:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N1cYu-0006Ei-6c for emacs-devel@gnu.org; Sat, 24 Oct 2009 05:05:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N1cYq-00067P-1L for emacs-devel@gnu.org; Sat, 24 Oct 2009 05:05:23 -0400 Original-Received: from [199.232.76.173] (port=57681 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1cYp-000677-Ns for emacs-devel@gnu.org; Sat, 24 Oct 2009 05:05:19 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:63568) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N1cYo-0003rE-Ss for emacs-devel@gnu.org; Sat, 24 Oct 2009 05:05:19 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0KS000200H0HZV00@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Sat, 24 Oct 2009 11:05:17 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.70.77.20]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KS0002P6H8SOR10@a-mtaout22.012.net.il>; Sat, 24 Oct 2009 11:05:17 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:116354 Archived-At: > Date: Sat, 24 Oct 2009 10:50:33 +0900 > Cc: emacs-devel@gnu.org > From: Toru TSUNEYOSHI > > val = make_fixnum_or_float (sign * v); /* <= type of argument is `double' */ > } > > So in 64-bit platforms, casting `double' to `int' causes lack of > precision already (because a double does not have 64 bits in the > mantissa), doesn't it? No. The cast inside make_fixnum_or_float is to EMACS_INT, not to `int'. On 64-bit platforms, EMACS_INT is a 64-bit type, so casting a `double' to EMACS_INT does not lose any precision. Casting an EMACS_INT to a `double' will cause loss of significant digits in the EMACS_INT value.