Loops/While: Difference between revisions

(Added Matlab Code)
Line 280:
=={{header|Matlab}}==
In Matlab (like Octave) the math is done floating point, then rounding to integer, so that 1/2 will be always 1 and never 0. A 'floor' is used to round the number.
<lang Matlab>i = 1024;
i = 1024;
while (i > 0)
disp(i);
i = floor(i/2);
end</lang>
</lang>
 
=={{header|MAXScript}}==
Anonymous user