From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#42597: 27.1; (+ -0.0) returns +0.0 when compiled (fwd) Date: Wed, 29 Jul 2020 15:41:27 +0200 (CEST) Message-ID: References: <1A998EAD-92A5-42FD-B382-33C0FE2A7D20@acm.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="351380202-517121245-1596030087=:82184" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25207"; mail-complaints-to="usenet@ciao.gmane.io" To: 42597@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 29 15:42:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k0mLR-0006QO-F2 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Jul 2020 15:42:09 +0200 Original-Received: from localhost ([::1]:34448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k0mLQ-0003Lh-HW for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Jul 2020 09:42:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k0mLK-0003La-1v for bug-gnu-emacs@gnu.org; Wed, 29 Jul 2020 09:42:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48846) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k0mLJ-00039e-Pf for bug-gnu-emacs@gnu.org; Wed, 29 Jul 2020 09:42:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k0mLJ-0000p7-O4 for bug-gnu-emacs@gnu.org; Wed, 29 Jul 2020 09:42:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <1A998EAD-92A5-42FD-B382-33C0FE2A7D20@acm.org> Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Jul 2020 13:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42597 X-GNU-PR-Package: emacs Original-Received: via spool by 42597-submit@debbugs.gnu.org id=B42597.15960300973128 (code B ref 42597); Wed, 29 Jul 2020 13:42:01 +0000 Original-Received: (at 42597) by debbugs.gnu.org; 29 Jul 2020 13:41:37 +0000 Original-Received: from localhost ([127.0.0.1]:60392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0mKu-0000oO-WE for submit@debbugs.gnu.org; Wed, 29 Jul 2020 09:41:37 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:51775 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1k0mKr-0000o4-SA for 42597@debbugs.gnu.org; Wed, 29 Jul 2020 09:41:35 -0400 Original-Received: (qmail 24915 invoked by uid 3782); 29 Jul 2020 13:41:27 -0000 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:183658 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --351380202-517121245-1596030087=:82184 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hello, Mattias. In article you wrote: > Unary +, *, min and max, all of which should be identity for numbers, > convert -0.0 to +0.0 when byte-compiled: They convert what? > (defun f (x) (+ x)) > (f -0.0) > =3D> -0.0 > (byte-compile 'f) > (f -0.0) > =3D> 0.0 > The reason is that byte-compile-associative transforms (+ x), (* x), > (min x) and (max x) into (+ x 0). > No patch yet (sorry!) but I'm not sure what would be the best way to go > about it. Some possibilities: > A. Use a full 1-argument call, like (+ x). This is more expensive > (about 1.8=C3=97) since the general function call mechanism has to be = used. > B. Use (* x 1) instead; this appears to work. This is also more > expensive (1.6=C3=97); not sure why. > C. Add a new byte-op. Fast but probably overkill. > Better suggestions welcome! This is an example of what happens when ignorant people rule the roost. -0.0 and +0.0 are identically the same thing. It should not take a degree in mathematics (which I have) to realise this. When you put mathematical nonsense into you cannot help but get nonsense back out. 0.0 does not need two different names. It can do nothing but produce confusion, what has clearly happened here at whatever level. So my suggestion D. would be: Eliminate "-0.0" from Emacs Lisp. If this is not possible for whatever reason, then E. Do nothing. --=20 Alan Mackenzie (Nuremberg, Germany). --351380202-517121245-1596030087=:82184--