min(sparse([0 %nan 3]), sparse([3 2 1])) does not ignore %nan. Same issue for max()
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
For dense inputs:
--> min([0 %nan 3], [3 2 1])
ans =
0. 2. 1.
--> max([0 %nan 3], [3 2 1])
ans =
3. 2. 3.
while for the same input but sparse-encoded:
--> full(min(sparse([0 %nan 3]), sparse([3 2 1])))
ans =
0. Nan 1.
--> full(max(sparse([0 %nan 3]), sparse([3 2 1])))
ans =
3. Nan 3.
The answer must not depend on the encoding.
ERROR LOG:
----------
None. Wrong answer.
HOW TO REPRODUCE THE BUG:
-------------------------
min([0 %nan 3], [3 2 1])
max([0 %nan 3], [3 2 1])
full(min(sparse([0 %nan 3]), sparse([3 2 1])))
full(max(sparse([0 %nan 3]), sparse([3 2 1])))
OTHER INFORMATION:
------------------
Same thing with Scilab 6.0.1