title: How to print a double value that is just less than another double value?
body: <p>Actually I am working on range expression in c++. So what I want is if I have any expression like </p>
  
  <pre><code>x&lt;1
  </code></pre>
  
  <p>Then my </p>
  
  <pre><code>double getMax(...);
  </code></pre>
  
  <p>should return a double value that is just before 1.000 (double precision) on a number line.</p>
  
  <p>I tried doing this</p>
  
  <pre><code>double getMax(double&amp; a)
  {
      return (a-numeric_limits&lt;double&gt;::min());
  }
  </code></pre>
  
  <p>But I am still getting same value as a in return statement.</p>
  
  <p>I think C++ is converting it to nearest double in cout statement.</p>
  
  <pre><code>int main()
  {
      double a = 32;
      cout&lt;&lt;scientific&lt;&lt;getMax(a)&lt;&lt;endl;
      return 0;
  }
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>3.200000e+001
  </code></pre>