h.dowhile

来自「强大的数学工具包」· DOWHILE 代码 · 共 53 行

DOWHILE
53
字号
                               * * * * * * *                               *  dowhile  *                               * * * * * * *        "dowhile-loop"        SYNTAX: dowhile(B, seq)        B is a boolean expression. seq is executed as long as the        value of B is nonzero, but at least once.        seq is a sequence of several expressions, separated by '_' or         ';'. If an expression ends with '_', its output is displayed,        if it ends with ';', its output is suppressed. The sequence        must not be empty.        Remark: The last expression of seq must not be terminated by                 '_' and need not be terminated by ';'. If you want its                 output to be suppressed, terminate it by ';'.                To avoid the output of unnecessary results during the                 computation, please use ';'.        At the end of the outermost loop, the values of all variables         used during the computation are displayed.        Endless loops are not recognized. Type "CTRL/C" to interrupt         the loop. In that case, the value of all variables are         displayed.        The overwrite protection mechanism is automatically disabled        in a loop. At the end of the loop, it is restored.          If an error occurs, the user is asked, if the loop should be        continued. If the answer is positive, the actual loop is continued,         else the loop is left.        "break" and "continue" may be used (see "? break","? continue").        Example 1: (correct)                dowhile(a > 0, fact(a)_a=a-1;)        Example 2: (correct)                dowhile(a>=(-5), if(a>=0,b=sqrt(a),break)_a=a-1;)        Example 3: (incorrect)                dowhile( t>2, r=3, t=t-1 )_ERR_NR_232

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?