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
}}}
didier
> > 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.
A random rational could then be the ratio of two such integers.
- Robert
> <3251.patch>
--
William Stein
Associate Professor of Mathematics
University of Washington