Ask Your Question

Revision history [back]

Hello,

Just to complete Thierry, answer I guess the most sageish way would be

sage: ZZ.random_element(0,10)
3

It is as fast as numpy and has the advantage of supporting arbitrary precision number. If you want something really fast see how ZZ.random_element is implemented using cython and gmp integers.

Vincent