It always returns 101, not a random prime of 100 bit integer. On 17 September 2011 18:04, Rajeev Singh <rajs2...@gmail.com> wrote:
> On Sat, Sep 17, 2011 at 5:46 PM, Santanu Sarkar > <sarkar.santanu....@gmail.com> 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 sage-support@googlegroups.com > > To unsubscribe from this group, send email to > > sage-support+unsubscr...@googlegroups.com > > 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 sage-support@googlegroups.com > To unsubscribe from this group, send email to > sage-support+unsubscr...@googlegroups.com > 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 sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org