Useful reading!

Thanks!

On Monday, August 18, 2014 1:36:24 PM UTC+1, Johan Sigfrids wrote:
>
> Maybe you are running into #5187 
> <https://github.com/JuliaLang/julia/issues/5187>?
>
> On Monday, August 18, 2014 3:11:44 PM UTC+3, Davide Lasagna wrote:
>>
>> Hi all, 
>>
>> Is this a bug or a feature?
>>
>> julia> idx = [1:10]
>> 10-element Array{Int64,1}:
>>   1
>>   2
>>   3
>>   4
>>   5
>>   6
>>   7
>>   8
>>   9
>>  10
>>
>> julia> idx .!= 2 & idx .!= 8
>> 10-element BitArray{1}:
>>   true
>>  false
>>   true
>>   true
>>   true
>>   true
>>   true
>>   true
>>   true
>>   true
>>
>> which appears wrong to me. However, by wrapping the two conditions by 
>> parenthesis:
>>
>> julia> (idx .!= 2) & (idx .!= 8)
>> 10-element BitArray{1}:
>>   true
>>  false
>>   true
>>   true
>>   true
>>   true
>>   true
>>  false
>>   true
>>   true
>>
>> which is the expected result. I would expect the two cases to give the 
>> same result, or at least, for the first one, to emit a sort of warning.
>>
>> Davide
>>
>>

Reply via email to