Previous Up Next

5.13.26  Sub-expression of an expression: part

part takes two arguments: an expression and an integer n.
part evaluate the expression and then returns the n-th sub-expression of this expression.
Input:

part(x^2+x+1,2)

Output:

x

Input:

part(x^2+(x+1)*(y-2)+2,2)

Output:

(x+1)*(y-2)

Input:

part((x+1)*(y-2)/2,2)

Output:

y-2

Previous Up Next