uniform(number)

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

uniform, function

def pure uniform(n: number): zedfunc

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

Example

f = uniform(2)

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

This outputs the following list:

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

Errors

Passing a non-integer n fails with:

'uniform(n)' is rounding fractional numbers.

See also

User Contributed Notes
0 notes + add a note