Random

<text size="0.8em">Working with statistics? See random (statistics) </text>

Returns a random number. One can specify the seed using random_seed(Integer).

Syntax

random()
random(Integer)
random(Real)
random(Integer, Integer)
random(Real, Real)

Description

Returns a random number in the interval (0,1).

calc.random1.calc.png

Given an integer n, returns a random integer number in the interval [0,n) (if nLaTeXn is positive) or (n,0] (if nLaTeXn is negative).

calc.random2.calc.png

Given a real x, returns a random real number in the interval [0,x) (if xLaTeXx is positive) or (x,0] (if xLaTeXx is negative).

calc.random3.calc.png

Given two integers numbers a and b, returns a random integer in the interval [a,b].

calc.random4.calc.png

Given two real numbers aLaTeXa and bLaTeXb, returns a random real number in the interval [a,b]LaTeX[a,b].

calc.random5.calc.png