Julia Logical Operations
julia> 1 | 1
1

julia> 1 | 0
1

julia> 0 | 1
1

julia> 0 | 0
0

julia> true | true true julia> true | false true julia> false | true true julia> false | false false
julia> 1 & 1 1 julia> 1 & 0 0 julia> 0 & 1 0 julia> 0 & 0 0
julia> true & true true julia> true & false false julia> false & true false julia> false & false false
julia> true+true 2 julia> false-true -1 julia> true-false 1 julia> false-false 0
julia> 1==1 true julia> 1<1 false julia> 1>1 false julia> 1>=1 true julia> 10//30==1//3 true
julia> NaN == NaN false julia> isequal(NaN, NaN) true julia> -0.0 == 0.0 true julia> isequal(-0.0, 0.0) false
Advertisement