Karim Belabas on Wed, 20 Jul 2011 17:40:19 +0200


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

Re: znlog() behavior


* Charles Greathouse [2011-07-20 15:54]:
> 2 is not a primitive root mod 7, so the output is undefined.

You're basically right, the result is undefined. More precisely : Max 
partially took into account that 2 is not primitive by adding the
'znorder(Mod(2,7))' parameter.

On the other hand

(16:16) gp > ?? znprimroot
[...]
   The  result  is  undefined  when  x  is  not  a  power of g or when x is not
invertible mod N:


In that case, 6 is not a power of 2 mod 7, so the result is undefined.

That also covers the other znlog (0, Mod(3,4)) problem :-)

Cheers,

  K.B.

> On Wed, Jul 20, 2011 at 9:31 AM, Max Alekseyev <maxale@gmail.com> wrote:
> > And here is another bug, isn't it?
> >
> > ? znlog(6,Mod(2,7),znorder(Mod(2,7)))
> > %2 = 1
> >
> > Regards,
> > Max
> >
> > On Wed, Jul 20, 2011 at 3:26 PM, Max Alekseyev <maxale@gmail.com> wrote:
> >> A different question - is the following a bug?
> >>
> >> ? znlog(0,Mod(3,4))
> >> %1 = 1
> >>
> >> It seems such to me. I would expect an error pop up.
> >>
> >> Regards,
> >> Max
--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux1.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]
`