next | previous | forward | backward | up | top | index | toc | home

random(Ring) -- random element of a ring

Synopsis

Description

random ZZ outputs a random integer from the closed interval bounded by -10 and 10.
i1 : random ZZ

o1 = -10
random QQ outputs a rational number whose numerator is a random integer from the closed interval bounded by -10 and 10 and whose denominator is a random integer from the closed interval bounded by 0 and 10.
i2 : random QQ

     4
o2 = -
     3

o2 : QQ
Note: not implemented yet for RR, CC, and polynomial rings.

See also