GNU bug report logs - #25255
Emacs calculator evalutes lcm to a negative number

Previous Next

Package: emacs;

Reported by: Bug Poster <bugzilla-mail-box <at> yandex.ru>

Date: Fri, 23 Dec 2016 17:16:02 UTC

Severity: normal

Tags: patch

Fixed in version 26.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25255 in the body.
You can then email your comments to 25255 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#25255; Package emacs. (Fri, 23 Dec 2016 17:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bug Poster <bugzilla-mail-box <at> yandex.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 23 Dec 2016 17:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bug Poster <bugzilla-mail-box <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: Emacs calculator evalutes lcm to a negative number
Date: Fri, 23 Dec 2016 19:32:19 +0900
GNU Emacs 24.3.1


This is formula of Least Common Multiple:

lcm(a, b) = |a * b| / gcd(a, b)


The calculator evaluates it, but doesn't take its absolute value.


Input:

5
n
<RET>
4
k
l

Output:

1: -20




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25255; Package emacs. (Sun, 05 Feb 2017 10:29:02 GMT) Full text and rfc822 format available.

Message #8 received at 25255 <at> debbugs.gnu.org (full text, mbox):

From: peder <at> klingenberg.no (Peder O. Klingenberg)
To: 25255 <at> debbugs.gnu.org
Subject: Re: bug#25255: Emacs calculator evalutes lcm to a negative number
Date: Sun, 05 Feb 2017 11:28:17 +0100
[Message part 1 (text/plain, inline)]
Bug Poster <bugzilla-mail-box <at> yandex.ru> writes:

> This is formula of Least Common Multiple:
>
> lcm(a, b) = |a * b| / gcd(a, b)

I agree, every textbook I can find defines lcm to return a positive
integer.  Here's a patch, which hopefully someone will apply.

[0001-LCM-is-defined-to-return-a-positive-integer.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
...Peder...

Added tag(s) patch. Request was from peder <at> klingenberg.no (Peder O. Klingenberg) to control <at> debbugs.gnu.org. (Sun, 05 Feb 2017 10:37:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25255; Package emacs. (Fri, 24 Feb 2017 01:32:02 GMT) Full text and rfc822 format available.

Message #13 received at 25255 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: peder <at> klingenberg.no (Peder O. Klingenberg)
Cc: bugzilla-mail-box <at> yandex.ru, 25255 <at> debbugs.gnu.org
Subject: Re: bug#25255: Emacs calculator evalutes lcm to a negative number
Date: Thu, 23 Feb 2017 20:30:46 -0500
Peder O. Klingenberg wrote:

> I agree, every textbook I can find defines lcm to return a positive
> integer.  Here's a patch, which hopefully someone will apply.

Thanks; applied as f6d2ba7.




bug marked as fixed in version 26.1, send any further explanations to 25255 <at> debbugs.gnu.org and Bug Poster <bugzilla-mail-box <at> yandex.ru> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 24 Feb 2017 01:32:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 24 Mar 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 90 days ago.

Previous Next


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