unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: David Ongaro <david.ongaro@hamburg.de>
Cc: 41279-done@debbugs.gnu.org
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	[thread overview]
Message-ID: <6029B2F2-E131-46D8-A32A-57B158477DEA@acm.org> (raw)
In-Reply-To: <20621430-4DFE-4E40-A616-9D404DDBB2BF@hamburg.de>

15 maj 2020 kl. 19.44 skrev David Ongaro <david.ongaro@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.






      reply	other threads:[~2020-05-15 18:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15  4:52 bug#41279: 26.3; Calc: sum(gcd(0,n),n,-1,-1) evaluates to -1 David Ongaro
2020-05-15 10:19 ` Mattias Engdegård
2020-05-15 17:44   ` David Ongaro
2020-05-15 18:21     ` Mattias Engdegård [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6029B2F2-E131-46D8-A32A-57B158477DEA@acm.org \
    --to=mattiase@acm.org \
    --cc=41279-done@debbugs.gnu.org \
    --cc=david.ongaro@hamburg.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).