GNU bug report logs - #15626
calc prime test fails for numbers > 8 million

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Wed, 16 Oct 2013 00:33:02 UTC

Severity: normal

Found in version 24.3

Done: Jay Belanger <jay.p.belanger <at> gmail.com>

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 15626 in the body.
You can then email your comments to 15626 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 jay.p.belanger <at> gmail.com, bug-gnu-emacs <at> gnu.org:
bug#15626; Package emacs. (Wed, 16 Oct 2013 00:33:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: submit <at> debbugs.gnu.org
Subject: calc prime test fails for numbers > 8 million
Date: Tue, 15 Oct 2013 20:32:15 -0400
Package: emacs
Version: 24.3

On x86_64 GNU/Linux:

emacs -Q -f calc
8000000 RET
k p
  -> Wrong type argument: listp, 8000000

Any number >= 8000000 (but < math-small-integer-size) fails in this way.

The problem is the

  (% (nth 1 n) 2) 0)

of math-prime-test, which still expects numbers larger than 8000000 to
be in (bigpos ... ) list format, but the limit is much greater than that
these days.

The calc manual is likewise outdated:

  19.5.7.1 Data Type Formats
  [...]
  Large integers are stored as lists of the form `(bigpos D0 D1 D2 ...)'
  for positive integers 1000000 or more,

(First reported at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679753 )




Reply sent to jay.p.belanger <at> gmail.com:
You have taken responsibility. (Thu, 17 Oct 2013 03:40:02 GMT) Full text and rfc822 format available.

Notification sent to Glenn Morris <rgm <at> gnu.org>:
bug acknowledged by developer. (Thu, 17 Oct 2013 03:40:04 GMT) Full text and rfc822 format available.

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

From: Jay Belanger <jay.p.belanger <at> gmail.com>
To: 15626-done <at> debbugs.gnu.org
Cc: Glenn Morris <rgm <at> gnu.org>, jay.p.belanger <at> gmail.com
Subject: Re: bug#15626: calc prime test fails for numbers > 8 million
Date: Wed, 16 Oct 2013 22:39:41 -0500
> On x86_64 GNU/Linux:
>
> emacs -Q -f calc
> 8000000 RET
> k p
>   -> Wrong type argument: listp, 8000000
>
> Any number >= 8000000 (but < math-small-integer-size) fails in this way.
>
> The problem is the
>
>   (% (nth 1 n) 2) 0)
>
> of math-prime-test, which still expects numbers larger than 8000000 to
> be in (bigpos ... ) list format, but the limit is much greater than that
> these days.
>
> The calc manual is likewise outdated:

Thanks; this has been fixed in bzr.
(I should increase the size of math-primes-table when I get the chance,
too.)

> (First reported at
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679753 )

Ack; I never saw this.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 14 Nov 2013 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 224 days ago.

Previous Next


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