title: lower_bound == upper_bound
body: <p>What does lower_bound mean. If I had to guess I would answer that this function returns the iterator at the last element that is less than the value asked for. But I see that lower_bound is almost the same as upper_bound. The only difference is strict inequality in the case of upper_bound. Is there a true lower bound selection function in stl that agrees with the normal definition of lower bound.</p>
  
  <p>EDIT: It was too many negations in the docs which made me confused. The problem was that I got the same iterator. I solved it by subtracting 1 from lower_bound return value. I use it for interpolation:</p>
  
  <pre><code>    float operator()(double f)
          {
          SpectrumPoint* l=std::lower_bound(beginGet(),endGet(),(SpectrumPoint){float(f),0.0f}
              ,SpectrumPoint::CompareFreqLessThan);
          if(l&gt;beginGet())
              {--l;}
  
          SpectrumPoint* u=std::lower_bound(beginGet(),endGet(),(SpectrumPoint){float(f),0.0f}
              ,SpectrumPoint::CompareFreqLessThan);
  
          if(u==endGet())
              {u=beginGet();}
  
          if(l==u)
              {
              if(u==endGet())
                  {return u-&gt;amp;}
              return l-&gt;amp;
              }
  
          double f_min=l-&gt;freq;
          double A_min=l-&gt;amp;
          double f_max=u-&gt;freq;
          double A_max=u-&gt;amp;
  
          double delta_f=f_max-f_min;
          double delta_A=A_max-A_min;
  
          return A_min + delta_A*(f-f_min)/delta_f;
          }
  </code></pre>
  
  <p>I am sorry for this confusion :-(</p>