Please note that the recommended version of Scilab is 6.0.0. This page might be outdated.
See the recommended documentation of this function
while clause. Must be terminated by
while expr ,instructions,...[,else instructions], end
while expr do instructions,...[,else instructions], end
while expr then instructions,...[,else instructions], end
The only constraint is that each
dokeyword must be on the same line line as
docan be replaced by a carriage return or a comma. For compatibility with Matlab it is also possible, but not recommended, to put a space between the end of the expression and the beginning of the first instruction.
,else instructionsconstruction allows to gives instructions which are executed when expr expression becomes false.
Warning: the number of characters used to define the body of any conditionnal instruction (if while for or select/case) must be limited to 16k.
e=1; a=1; k=1; while norm(a-(a+e),1) > %eps, e=e/2; k=k+1; end e,k