title: Find equal or nearest smaller value from an array
body: <p>Let's suppose I have this array <em>(it is actually 255 long, values up to int.MaxValue)</em>:</p>
  
  <pre><code>int[] lows = {0,9,0,0,5,0,0,8,4,1,3,0,0,0,0};
  </code></pre>
  
  <p>From this array I would like to get index of a value <strong>equal</strong> or <strong>smaller</strong> to my number.</p>
  
  <pre><code>number = 7 -&gt; index = 4
  number = 2 -&gt; index = 9
  number = 8 -&gt; index = 7
  number = 9 -&gt; index = 1
  </code></pre>
  
  <p>What would be the fastest way of finding it? </p>
  
  <p>So far I've used linear search, but that turned out to be too inefficient for my need, because even though this array is only 255 long, values will be searched for a few million times. </p>
  
  <p>I would need something equal to <em>TreeSet.floor(E)</em> used in java. I wanted to use <em>Dictionary</em>, but i don't know if it can find first smaller or equal value like I need.</p>