Robert, thanks for clearing that up for me.

However, I think it's still desirable to leave "unsorted" as an
option, even though as you said now sorting doesn't take up the
majority of the time. For example, it will be a waste of computing
time if divisors is followed by some operations that may screw up the
order but then one does want a sorted result at the end.



On Dec 4, 10:06 pm, Robert Bradshaw <[EMAIL PROTECTED]>
wrote:
> On Dec 4, 2008, at 9:35 PM, pong wrote:
>
>
>
> > In SAGE 3.2.1 , the docstring of divisors says:
>
> > Definition:        divisors(n)
> > Docstring:
>
> >         Returns a list of all positive integer divisors
> >         of the nonzero integer n.
>
> >         A second parameter may be passed to surpress sorting
> >         of the list (as ordering the list can be more time
> >         consuming then creating it).
>
> >         INPUT:
> >             n -- the element
> >             sorted -- whether or not to sort the output (default True)
>
> > My question is how to get an unsorted output?
>
> > I tried divisors(300, sorted=False) but SAGE complaints that divisors
> > only takes 1 argument. In fact, the source codes seem to suggest that
> > it will always return a sorted list.
>
> You are correct, now the divisors are always returned sorted (as we  
> have resolved the issue of sorting taking the majority of the time).  
> The documentation needs to be fixed.
>
> http://trac.sagemath.org/sage_trac/ticket/4710
>
> - Robert
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to