How to return ceiling of a number without using cmath
<p>How can I get the floor of two inputs of type double without using cmath:
this is what it works if the first input is negative but will not work for a positive integer not sure where its going wrong?? any insight is appreciated.. thank you</p>

<pre><code> int main()
{
 floors=floor(n1);
 cout&lt;&lt; " The floor of value 1 is " &lt;&lt;floors&lt;&lt;endl;
 floors=floor(n2);
 cout&lt;&lt;" The floor of value 2 is " &lt;&lt;floors&lt;&lt;endl;


long floor(long f)
{
  if( (f+ 0.5) &gt;= (int(f)-1) )
  return int (f)-1;
  else 
  return int (f);
}
</code></pre>
