==== IFTE ==== ---- ---- Execute objects on the stack conditionally ---- ^ __Input Stack__ ^^^ ^ __Output Stack__ ^ | **1** | **Otrue** | **Ofalse** | **→** | **[Otrue]XEQ** | | **0** | **Otrue** | **Ofalse** | **→** | **[Ofalse]XEQ** | | //Level 3 / Argument 1// | //Level 2 / Argument 2// | //Level 1 / Argument 3// | //→// | //Level 1// | {{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}} |**Type**| [[manual:chapter5:basics#functions|Function]] || |**Parallel list processing**| [[manual:chapter5:listproc#group-2commands-that-must-use-dolist-to-parallel-process|Group 2]] || |**Affected by flags**| None || ---- 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. ---- This command is fully compatible with userRPL. ---- 3: 1 2: { 'X' 'Y' 'Z' } 1: 1_m …………………………………………………………………………………… IFTE will result in 1: { 'X' 'Y' 'Z' } …………………………………………………………………………………… ---- {{page>manual:chapter6:stack&nofooter&noeditbtn&inline}}