Max Alekseyev on Wed, 20 Jul 2011 17:05:05 +0200


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

Re: znlog() behavior


In the development version, there is no restrictions regarding primitive roots:

? ?znlog
znlog(x,g,{o}): return the discrete logarithm of x in (Z/nZ)* in base g. If
present, o represents the multiplicative order of g. If no o is given, assume
that g generate (Z/nZ)*.

In my example, I've provided the order o as requested for non-primitive roots.

Regards,
Max


On Wed, Jul 20, 2011 at 3:47 PM, Charles Greathouse
<charles.greathouse@case.edu> wrote:
> 2 is not a primitive root mod 7, so the output is undefined.
>
> Charles Greathouse
> Analyst/Programmer
> Case Western Reserve University
>
> 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
>>>
>>
>