Unexpected iterator assigment in empty for loop
@benoitpremy)
Reported by Benoît Remy (BUG DESCRIPTION:
----------------
When an empty 'for' loop is executed, an unexpected value is assigned to the iterator, which is random but usually extremely small (approximately 1e-310). One would expect no value or an empty value or 1 or 0 to be assigned to the iterator, but it is not the case.
ERROR LOG:
----------
(No error)
HOW TO REPRODUCE THE BUG:
-------------------------
clear("k");
for k = 1:0 // This situation can happen when trying to loop on an empty array for example.
// Anything here
end
// Check value of k:
k
isempty(k)
k==1
k==0
OTHER INFORMATION:
------------------
In this example, 'k' is the iterator, but it happens for any variable name.
If an empty array ('[]') is used instead of "1:0", no value is assigned to the iterator, as expected.
Edited by scilab bot