This shows you the differences between two versions of the page.
Both sides previous revision
Previous revision
|
Last revision
Both sides next revision
|
manual:chapter6:stack:cmd_ifte [2019/11/05 01:05] jojo1973 |
manual:chapter6:stack:cmd_ifte [2019/11/12 14:14] jojo1973 |
---- | ---- |
^ __Input Stack__ ^^^ ^ __Output Stack__ ^ | ^ __Input Stack__ ^^^ ^ __Output Stack__ ^ |
| **1** | **O<sub>true</sub>** | **O<sub>false</sub>** | **→** | **O<sub>true</sub>** | | | **1** | **O<sub>true</sub>** | **O<sub>false</sub>** | **→** | **[O<sub>true</sub>]<sub>XEQ</sub>** | |
| **0** | **O<sub>true</sub>** | **O<sub>false</sub>** | **→** | **O<sub>false</sub>** | | | **0** | **O<sub>true</sub>** | **O<sub>false</sub>** | **→** | **[O<sub>false</sub>]<sub>XEQ</sub>** | |
| //Level 3 / Argument 1// | //Level 2 / Argument 2// | //Level 1 / Argument 3// | //→// | //Level 1// | | | //Level 3 / Argument 1// | //Level 2 / Argument 2// | //Level 1 / Argument 3// | //→// | //Level 1// | |
| |
<callout color="orangered" icon="fa fa-comment" title="Description"> | <callout color="orangered" icon="fa fa-comment" title="Description"> |
---- | ---- |
The ''IFTE'' function tests the object on level 3 of the stack: if it is [[manual:chapter6:operators:cmd_ovr_istrue|true]] then it ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''%%'%%tes the object on level 2, otherwise it ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''%%'%%tes the object on level 1. | The ''IFTE'' function tests the object on level 3 of the stack: if the test returns ''1'' then it ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''%%'%%tes the object on level 2, otherwise it ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''%%'%%tes the object on level 1. |
| |
''IFTE'' can be used in symbolic expressions to define piecewise functions. | ''IFTE'' can be used in symbolic expressions to define piecewise functions. |