From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#41279: 26.3; Calc: sum(gcd(0,n),n,-1,-1) evaluates to -1 Date: Fri, 15 May 2020 20:21:47 +0200 Message-ID: <6029B2F2-E131-46D8-A32A-57B158477DEA@acm.org> References: <7D48D15C-1F8E-41C8-9B1C-650215C8101D@acm.org> <20621430-4DFE-4E40-A616-9D404DDBB2BF@hamburg.de> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="98397"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41279-done@debbugs.gnu.org To: David Ongaro Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 15 20:22:16 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 1jZeyN-000PVn-S1 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 May 2020 20:22:15 +0200 Original-Received: from localhost ([::1]:58812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZeyM-0005Wb-MM for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 May 2020 14:22:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZeyB-0005Vq-1f for bug-gnu-emacs@gnu.org; Fri, 15 May 2020 14:22:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55390) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jZeyA-00089d-P1 for bug-gnu-emacs@gnu.org; Fri, 15 May 2020 14:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jZeyA-0005I8-KE for bug-gnu-emacs@gnu.org; Fri, 15 May 2020 14:22:02 -0400 Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 May 2020 18:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 41279 X-GNU-PR-Package: emacs Mail-Followup-To: 41279@debbugs.gnu.org, mattiase@acm.org, david.ongaro@hamburg.de Original-Received: via spool by 41279-done@debbugs.gnu.org id=D41279.158956691920325 (code D ref 41279); Fri, 15 May 2020 18:22:02 +0000 Original-Received: (at 41279-done) by debbugs.gnu.org; 15 May 2020 18:21:59 +0000 Original-Received: from localhost ([127.0.0.1]:38703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZey6-0005Hk-TY for submit@debbugs.gnu.org; Fri, 15 May 2020 14:21:59 -0400 Original-Received: from mail212c50.megamailservers.eu ([91.136.10.222]:58538 helo=mail194c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZey4-0005HR-R9 for 41279-done@debbugs.gnu.org; Fri, 15 May 2020 14:21:58 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1589566910; bh=6hTM6/4lee8QoEyRUFUjwMCR5PTpBS28QXa3Q/VIq4E=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=LS9AtMix4FZco9QnWDhCxsePkRDQRKw60PAV25cdiciJR+lc51niF8BefCPrmW/Os 9XN3ORAXBYUsRK18J+u8ozJRbuZ2fCMSapyiOLFZEqDYx2lf6srDRmGC5LCEdXgraJ kaVGYlE5TDczZvySVdxzwsQQqhurwH+EcD+CKnmE= Feedback-ID: mattiase@acm.or Original-Received: from stanniol.lan (c-4e4ae655.032-75-73746f71.bbcust.telenor.se [85.230.74.78]) (authenticated bits=0) by mail194c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 04FILmaw027570; Fri, 15 May 2020 18:21:49 +0000 In-Reply-To: <20621430-4DFE-4E40-A616-9D404DDBB2BF@hamburg.de> X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F29.5EBEDD41.000B, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=KsozJleN c=1 sm=1 tr=0 a=klNLuyVZdLUgl+K5Uafb2A==:117 a=klNLuyVZdLUgl+K5Uafb2A==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=rTYYZ9R0T1RneXnqtekA:9 a=CjuIK1q_8ugA:10 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:180349 Archived-At: 15 maj 2020 kl. 19.44 skrev David Ongaro : > I see, so the simplest reproduction of the bug doesn't involve the = sum, but just the evaluation of gcd(0, x) or gcd(x, 0). Your fix seems = sensible to me, I don't see why you consider it a 'hack'. The = simplification gcd(0, x)=3Dgcd(x, 0)=3Dabs(x) seems legit and matches = the gcd definition "The largest positive integer that divides each of = the integers". Quite, but there is a small possibility that further simplification = relies on the gcd(0,x)=3Dx behaviour. You never know with Calc: it is = complex and everything seems interconnected. After all, abs is often an = obstacle in algebraic transforms; you often end up splitting cases. That said, it's probably the right thing to do. Now pushed to master, = which means that you need to build a development snapshot from source, = or apply the change (60cd6cce55) to your Emacs.