Mendenbarr

converttoint

Sep 13th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.10 KB | None | 0 0
  1. int convertToNearestInt(double x){
  2.     if (x - .5 >= (int)x ) return (int)(x + 1);
  3.     else return (int)x ;
  4. }
Advertisement
Add Comment
Please, Sign In to add comment