[top][index]
search for:

random RR -- random real number

Synopsis:

  • Function: random -- get a random element
  • Input:
  • an instance of class RR.
  • Output:
  • an instance of class RR.
  • random x -- yields a random real number in the range 0 .. x.

    See also:

  • setRandomSeed -- set starting point for random number generator
  • Code:

         -- ../../../Macaulay2/m2/integers.m2:74-78
         random RR := RR => x -> (
              if x <= 0. then (
                   error "expected a positive number"
                   );
              x * (randomint() / d))

    [top][index]
    search for: