Rounding up and down a number C++
<p>I'm trying to allow my program to round a number up and down respectively. </p>

<p>For example, if the number is <code>3.6</code>, my program is suppose to round up the nearest number which is 4 and if the number is <code>3.4</code>, it will be rounded down to 3.</p>

<p>I tried using the <code>ceil</code> library to get the average of 3 items.</p>

<p><code>results = ceil((marks1 + marks2 + marks3)/3)</code></p>

<p>However, the <code>ceil</code> only rounds the number down but does not roll the number up.</p>

<p>There's 1 algorithm i stumbled upon</p>

<p><code>var roundedVal = Math.round(origVal*20)/20;</code></p>

<p>but i still can't figure a formula for some problem.</p>