It always returns 101, not a random prime of 100 bit integer.

On 17 September 2011 18:04, Rajeev Singh <[email protected]> wrote:

> On Sat, Sep 17, 2011 at 5:46 PM, Santanu Sarkar
> <[email protected]> wrote:
> > Hi all,
> >
> > I want to use cython.
> >
> > The following code does not work
> > %cython
> > cdef P
> > P = next_prime(ZZ.random_element(2^(100-1),2^100))
> >
> >
> > --
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> > http://groups.google.com/group/sage-support
> > URL: http://www.sagemath.org
> >
>
> Try this -
>
> %cython
> from sage.all import *
> cdef P
> P = next_prime(ZZ.random_element(2^(100-1),2^100))
> print P
>
> Rajeev
>
> --
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to