|
From: | GNU bug Tracking System |
Subject: | bug#42597: closed (27.1; (+ -0.0) returns +0.0 when compiled) |
Date: | Fri, 07 Aug 2020 08:53:02 +0000 |
Your message dated Fri, 7 Aug 2020 10:50:19 +0200 with message-id <8E812D2B-DAFD-433F-8A77-44946CD51F4F@acm.org> and subject line Re: bug#42597: 27.1; (+ -0.0) returns +0.0 when compiled has caused the debbugs.gnu.org bug report #42597, regarding 27.1; (+ -0.0) returns +0.0 when compiled to be marked as done. (If you believe you have received this mail in error, please contact help-debbugs@gnu.org.) -- 42597: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=42597 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems
--- Begin Message ---Subject: 27.1; (+ -0.0) returns +0.0 when compiled Date: Wed, 29 Jul 2020 14:07:32 +0200 Unary +, *, min and max, all of which should be identity for numbers, convert -0.0 to +0.0 when byte-compiled: (defun f (x) (+ x)) (f -0.0) => -0.0 (byte-compile 'f) (f -0.0) => 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×) 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×); not sure why. C. Add a new byte-op. Fast but probably overkill. Better suggestions welcome!
--- End Message ---
--- Begin Message ---Subject: Re: bug#42597: 27.1; (+ -0.0) returns +0.0 when compiled Date: Fri, 7 Aug 2020 10:50:19 +0200 No immediate objections at least; patches pushed to master.
--- End Message ---
[Prev in Thread] | Current Thread | [Next in Thread] |