# Quick simple example of the problem I'm running into. Is there something I'm missi

**URL:** <https://discourse.julialang.org/t/quick-simple-example-of-the-problem-im-running-into-is-there-something-im-missi/54945>\
**Category:** General Usage\
**Created:** [February 9, 2021, 5:48pm UTC](https://discourse.julialang.org/t/quick-simple-example-of-the-problem-im-running-into-is-there-something-im-missi/54945 "2021-02-09T17:48:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BridgeBot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bridgebot/32/21491_2.png) [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Post date:** [February 9, 2021, 5:48pm UTC](https://discourse.julialang.org/t/quick-simple-example-of-the-problem-im-running-into-is-there-something-im-missi/54945/1 "2021-02-09T17:48:42Z")

</div>

Quick simple example of the problem I’m running into. Is there something I’m missing on how to do this? I have more than 2 conditions for my thing and I want a bit array returned based on different arrays.

```julia
julia&gt; [1.0, 1.5] .&lt;= 2 &amp;&amp; [2.0, 2.5] .&lt;= 3
ERROR: TypeError: non-boolean (BitArray{1}) used in boolean context
Stacktrace:
 [1] top-level scope at REPL[25]:1

```

Note that the original poster on Slack cannot see your response here on Discourse. Consider _transcribing the appropriate answer back to Slack_, or pinging the poster here on Discourse so they can _follow this thread_.  
[(Original message :slack:)](https://julialang.slack.com/archives/C6A044SQH/p1612892909378300?thread_ts=1612892909.378300&cid=C6A044SQH) [(More Info)](https://github.com/JuliaCommunity/SlackBridge)

---

<div class="post-metadata">

**Author:** ![apo383](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apo383/32/11272_2.png) [@apo383](https://discourse.julialang.org/u/apo383)\
**Post date:** [February 9, 2021, 7:33pm UTC](https://discourse.julialang.org/t/quick-simple-example-of-the-problem-im-running-into-is-there-something-im-missi/54945/2 "2021-02-09T19:33:17Z")

</div>

You probably want bitwise with broadcasting:

```julia
julia> ([1.0,1.5] .<= 2) .& ([2.0,2.5] .<= 3)
2-element BitArray{1}:
 1
 1

```

The error message says your operands are `BitArray`s (bitwise arrays), and “boolean context” refers to `&&` which operates on booleans not bits. Bitwise means you should use `&`, and array means you should broadcast with `.`.

The error messages can be confusing, but they can often be decoded. If you do `? &&` or `? &` in REPL, the docstrings say boolean and bitwise, respectively.
