title: modf returns 1 as the fractional:
body: <p>I have this static method, it receives a double and "cuts" its fractional tail leaving two digits after the dot. works <em>almost</em> all the time. I have noticed that when
  it receives 2.3 it turns it to 2.29. This does not happen for 0.3, 1.3, 3.3, 4.3 and 102.3.
  Code basically multiplies the number by 100 uses modf divides the integer value by 100 and returns it.
  Here the code catches this one specific number and prints out:</p>
  
  <pre><code>static double dRound(double number) {
  
      bool c = false;
      if (number == 2.3)
          c = true;
  
  
      int factor = pow(10, 2);
      number *= factor;
  
  
      if (c) {
          cout &lt;&lt; " number *= factor : " &lt;&lt; number &lt;&lt; endl;
          //number = 230;// When this is not marked as comment the code works well.
      }
  
  
      double returnVal;
      if (c){
          cout &lt;&lt; " fractional : " &lt;&lt; modf(number, &amp;returnVal) &lt;&lt; endl;
          cout &lt;&lt; " integer : " &lt;&lt;returnVal &lt;&lt; endl;
      }
  
  
      modf(number, &amp;returnVal);
      return returnVal / factor;
  }
  </code></pre>
  
  <p>it prints out:</p>
  
  <p>number *= factor : 230</p>
  
  <p>fractional : 1</p>
  
  <p>integer : 229</p>
  
  <p>Does anybody know why this is happening and how can i fix this?
  Thank you, and have a great weekend.</p>