title: How to return boolean array in numba.njit?
body: <pre><code>import numpy as np
  from numba import njit, float64
  from numba.experimental import jitclass
  
  @njit(fastmath=True)
  def compare(values1, values2):
      shape = values1.shape[0]
      res = np.zeros(shape, dtype=bool)
      
      for i in range(shape):
          res[i] = x[i] &gt; y[i]
      
      return res
  
  spce = [(&quot;x&quot;, float64[:]),
          (&quot;y&quot;, float64[:]),
          (&quot;z&quot;, float64[:]),]
          
  @jitclass(spce)
  class Math:
      
      def __init__(self, x, y, z):
          self.x = x
          self.y = y
          self.z = z
      
      def calculate(self):
          i = compare(self.x, self.y)
          return self.z[i]
  </code></pre>
  <p>If I testing like this:</p>
  <pre><code>x = np.random.rand(10)
  y = np.random.rand(10)
  compare(x, y)
  </code></pre>
  <p>It will return:</p>
  <pre><code>Traceback (most recent call last):
  
    File &quot;&lt;ipython-input-25-586dc5d173c7&gt;&quot;, line 3, in &lt;module&gt;
      compare(x, y)
  
    File &quot;C:\Users\Option00\Anaconda3\envs\bot\lib\site-packages\numba\core\dispatcher.py&quot;, line 415, in _compile_for_args
      error_rewrite(e, 'typing')
  
    File &quot;C:\Users\Option00\Anaconda3\envs\bot\lib\site-packages\numba\core\dispatcher.py&quot;, line 358, in error_rewrite
      reraise(type(e), e, None)
  
    File &quot;C:\Users\Option00\Anaconda3\envs\bot\lib\site-packages\numba\core\utils.py&quot;, line 80, in reraise
      raise value.with_traceback(tb)
  
  TypingError: No implementation of function Function(&lt;built-in function zeros&gt;) found for signature:
   
  zeros(int64, dtype=Function(&lt;class 'bool'&gt;))
   
  There are 2 candidate implementations:
    - Of which 2 did not match due to:
    Overload of function 'zeros': File: numba\core\typing\npydecl.py: Line 504.
      With argument(s): '(int64, dtype=Function(&lt;class 'bool'&gt;))':
     No match.
  
  During: resolving callee type: Function(&lt;built-in function zeros&gt;)
  During: typing of call at &lt;ipython-input-24-69a4f907fb89&gt; (4)
  </code></pre>
  <p>Finally I need to use it in the jitclass:</p>
  <pre><code>x = np.random.rand(10)
  y = np.random.rand(10)
  z = np.random.rand(10)
  
  m = Math(x, y, z)
  m.calculate()
  </code></pre>
  <p>Actually the output is just z[x&gt;y] in numpy, but how i can use in njit &amp; jitclass?</p>
  <p>I need both of them for speed up my others code.</p>
  <p>If the compare function can be return boolean array, the problem should be solved.</p>