uniform(number, number)

There are other functions named uniform() with different numbers of arguments. See the entire list.

uniform, function

def pure uniform(min: number, max: number): zedfunc

Returns a zedfunc equal to 1 for integers k in [min, max] and 0 otherwise.

Example

f = uniform(2, 3)

show summary "uniform(2, 3)" with
  valueAt(f, 1) as "k=1"
  valueAt(f, 2) as "k=2"
  valueAt(f, 3) as "k=3"
  valueAt(f, 4) as "k=4"

This outputs the following list:

Label Value
k=1 0
k=2 1
k=3 1
k=4 0

Errors

Passing a non-integer bound fails with:

'uniform(min,max)' is rounding fractional numbers in 'min'.
'uniform(min,max)' is rounding fractional numbers in 'max'.

If min > max, Envision reports:

'uniform(min,max)' has 'min' greater than 'max+1'.

See also

User Contributed Notes
0 notes + add a note