Page 3-37
Combined IFTE functions
To program a more complicated function such as
you can combine several levels of the IFTE function, i.e.,
‘g(x) = IFTE(x<-2, -x, IFTE(x<0, x+1, IFTE(x<2, x-1, x^2)))’,
Define this function by any of the means presented above, and check that
g(-3) = 3, g(-1) = 0, g(1) = 0, g(3) = 9.
⎪
⎪
⎩
⎪
⎪
⎨
⎧
≥
<≤−
<≤−+
−<−
=
2,
20,1
02,1
2,
)(
2
xx
xx
xx
xx
xg