I don't understand why. problems with double : <p>Why doubles round themselves? How can i prevent it?
If i insert 45000.98 i expect 45000.98, but the number is rounded.</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;iomanip&gt;

using namespace std;

int main()
{
    double a;
    cin &gt;&gt; a;   //if i insert 45000.98
    cout &lt;&lt; a;   //output is 45001
    cout &lt;&lt; endl &lt;&lt; setprecision(2) &lt;&lt; a;   //output is 4.5e+04
}
</code></pre>
