Кусочные (составные) функции
Можно определять процедуры с оператором if:
f:=x->piecewise(cond1,expr1,expr2); |
g:=x->piecewise(cond1,expr1,cond2,expr2,expr3); |
f:=proc(x) if cond1 then expr1 else expr2 end if; end proc; |
g:=proc(x) if cond1 then expr1 elif cond2 then expr2 else expr3 end if; end proc; |