Charles Greathouse on Wed, 12 Jan 2011 21:14:51 +0100

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Possible bug in znprimroot

I think that an infinite loop is acceptable as undefined behavior (as
it would be in, e.g., C).  If this could be avoided without much cost
it would be nice, but I wouldn't want to expend much effort in
checking inputs.

Charles Greathouse
Case Western Reserve University

On Wed, Jan 12, 2011 at 1:35 PM, John Cremona <> wrote:
> On 12 January 2011 13:05, Bill Allombert
> <> wrote:
>> On Wed, Jan 12, 2011 at 03:00:14AM -0500, Max Alekseyev wrote:
>>> myroots(p) expects p to be prime, while 1729 is not prime.
>>> That's probably the reason that triggers the bug.
>>> Anyway, Floating Point Exception should not happen under any circumstances.
>> Agreed, but this only onccurs with PARI 2.4.2. With PARI 2.4.3, this results in an
>> infinite loop instead. This is in line with the documentation that state that:
>>  If the group is not cyclic,  the result  is undefined.
> "undefined" and causing an infinite loop are rather different!  Surely
> no reasonable (even wrong) input should cause an infinite loop?
> John
>> Cheers,
>> Bill.