GNU bug report logs - #41279
26.3; Calc: sum(gcd(0,n),n,-1,-1) evaluates to -1

Previous Next

Package: emacs;

Reported by: David Ongaro <david.ongaro <at> hamburg.de>

Date: Fri, 15 May 2020 04:54:02 UTC

Severity: normal

Found in version 26.3

Done: Mattias EngdegÄrd <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 41279-done <at> debbugs.gnu.org (full text, mbox):

From: Mattias EngdegÄrd <mattiase <at> acm.org>
To: David Ongaro <david.ongaro <at> hamburg.de>
Cc: 41279-done <at> debbugs.gnu.org
Subject: Re: bug#41279: 26.3; Calc: sum(gcd(0,n),n,-1,-1) evaluates to -1 
Date: Fri, 15 May 2020 20:21:47 +0200
15 maj 2020 kl. 19.44 skrev David Ongaro <david.ongaro <at> hamburg.de>:

> 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)=gcd(x, 0)=abs(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)=x 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.





This bug report was last modified 5 years and 10 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.