"unique" can't differentiate complex numbers
Reported by ROUX philippe
BUG DESCRIPTION:
----------------
from the help page we have :
"extract unique components of a vector or matrices"
but "unique" can only extract unique values for sortable object (so only reals numbers) and fail with non-sortable objects (complex, polynomials) as we can see in the example :
-->unique ([1 -1 1 -1])// good
ans =
- 1. 1.
-->unique ([1 -1 1 -1]*%i) // should give [-%i %i]
ans =
- i i - i i
ERROR LOG:
----------
no error, at least it should be document in the help page of "unique"
HOW TO REPRODUCE THE BUG:
-------------------------
L1=[1 -1 1 -1]*%i
L2=unique(L1)
length(find(L2==%i))==1 // %F due to the bug
OTHER INFORMATION:
------------------
tested on scilab 5.5.2 and 6.0.O