title: error with creating a round_up(float) function in C
body: <p>I am trying to write a round_up function that converts a float number to integer, but there seems to be error with my way of getting the decimal digits (the remainder of float number % 1). If the float number is 4.4, I wish to convert it to 4; if it's 4.5, I wish to convert it to 5.
   <strong>Error message: error: invalid operands to binary % (have ‘float’ and ‘int’)</strong></p>
  
  <pre><code>int round_up(float x)
  {
      int remainder;
      int ret_whole_num;
  
      ret_whole_num = x/1;
      remainder = x % 1.0;   /* this causes errors */
  
      if (remainder &gt; 5) 
          return ret_whole_num += 1;
  
      return ret_whole_num;
  }
  </code></pre>