More concretely, && and || are control flow operators. They short circuit.
Therefore, they require Boolean arguments and aren't real functions.
They're syntax.
& and | are bitwise operations and real, extendable functions. They can
operate on booleans *and* integers, performing bitwise arithmetic (often
used for bit flags):
julia> 0x2345 & 0x0F0F
0x0305
julia> ans | 0x6070
0x6375
On Monday, September 21, 2015 at 1:09:31 PM UTC-4, Sisyphuss wrote:
>
> & works for array
> && works for scale
>
>
> On Monday, September 21, 2015 at 6:50:48 PM UTC+2, Daniel Carrera wrote:
>>
>>
>> On Monday, 21 September 2015 14:39:13 UTC+2, Yichao Yu wrote:
>>>
>>>
>>> julia> [true, true, false] & [false, true, true]
>>> 3-element Array{Bool,1}:
>>> false
>>> true
>>> false
>>>
>>
>> Thanks! What is the difference between & and && ?
>>
>