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 12:11:01 +0200 Message-ID: <83r5stf6fe.fsf@gnu.org> References: <83y6n1gb14.fsf@gnu.org> <20091024.105033.100383844.t_tuneyosi@hotmail.com> <20091024.150744.186061320.t_tuneyosi@hotmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1256379135 26945 80.91.229.12 (24 Oct 2009 10:12:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Oct 2009 10:12:15 +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 12:12:08 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 1N1dbT-0005YO-AD for ged-emacs-devel@m.gmane.org; Sat, 24 Oct 2009 12:12:07 +0200 Original-Received: from localhost ([127.0.0.1]:50437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1dbR-0003dN-Up for ged-emacs-devel@m.gmane.org; Sat, 24 Oct 2009 06:12:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N1dbJ-0003cQ-5r for emacs-devel@gnu.org; Sat, 24 Oct 2009 06:11:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N1dbD-0003Yc-6k for emacs-devel@gnu.org; Sat, 24 Oct 2009 06:11:55 -0400 Original-Received: from [199.232.76.173] (port=34666 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1dbD-0003YV-3i for emacs-devel@gnu.org; Sat, 24 Oct 2009 06:11:51 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:43005) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N1dbC-0004jI-Kp for emacs-devel@gnu.org; Sat, 24 Oct 2009 06:11:50 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0KS000G00K2GCC00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sat, 24 Oct 2009 12:11:03 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.70.77.20]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KS000FJXKACRE20@a-mtaout20.012.net.il>; Sat, 24 Oct 2009 12:11:01 +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:116359 Archived-At: > Date: Sat, 24 Oct 2009 16:46:55 +0900 > Cc: emacs-devel@gnu.org > From: Toru TSUNEYOSHI > > >> 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? > > > > So I make a patch for keep the precision. > > It tries to deal with the number in type `int' possibly, otherwise it > > deals with the number in type `double'. > > > > Would you like to check it ? > > I revised the patch. I think we should fix the make_fixnum_or_float macro, rather than work around it in C code. > +#ifdef _LP64 > + if (v > LONG_MAX / b) This will probably not portable enough, e.g. on 64-bit Windows. We have MOST_POSITIVE_FIXNUM precisely for that reason.