Navigation :
constant
constant, function
def pure constant(a: number): zedfunc
Returns the zedfunc representing the constant function $f: x \mapsto a$.
a: the constant value returned for any input.
Examples
f = constant(3)
show table "Constant" with
valueAt(f, -1) as "k=-1"
valueAt(f, 0) as "k=0"
valueAt(f, 1) as "k=1"
Output:
The constant() function is unrelated to the const keyword, which controls compile-time evaluation.