On 3/1/07, didier deshommes <[EMAIL PROTECTED]> wrote:
> On 2/25/07, Craig Citro <[EMAIL PROTECTED]> wrote:
> > Hey all,
> >
> > So I tried to generate a random polynomial today, and ran into some trouble.
> > Here's what I did:
> >
> > sage: R.<x> = ZZ['x']
> > sage: R.random_element(3)
> > <sage crashes>
>
> That is a nice edge case. I would say that or you just return 0
> everytime. Other rings seem to do that:
> {{{
> sage: RR.random_element(0)
>  0.000000000000000
> sage: QQ.random_element(0)
>  0
> sage: RDF.random_element(0)
>  0.143951483848
> }}}

> > I traced back the problem, and it's not clear what the right fix is. So
> > R.random_element makes a list of the appropriate length and calls
> > ZZ.random_element(0) to fill it up. In the comments, it clearly explains why

I've fixed this for sage > 2.2.  The patch is attached in case you're
interested.

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Attachment: 3251.patch
Description: Binary data

Reply via email to