Hi, I was just implementing a code for my work and inside a very long code, I had used findall() to find the set of numbers that satisfy certain property. But I found an unexpected result and when I tried debugging the code found this behaviour. Which feels to be wrong.
nums=[1,2,3]
test=[1,2,3,4,5,6]
choicenonnums=findall(x->x∉nums,test)
This provides the right output, which is all the numbers in the array test
that are not in nums
array.
julia> choicenonnums=findall(x->x∉nums,test)
3-element Vector{Int64}:
4
5
6
But when I change the test array as a single number array. Or an array of length 1. It gives [1] as output.
julia> test=[75]
1-element Vector{Int64}:
75
julia> choicenonnums=findall(x->x∉nums,test)
1-element Vector{Int64}:
1
Is this some obscure use of findall() that I am not aware of? Or is this a bug?