00001 #include "stdafx.h" 00002 #include "Common.h" 00003 00004 int roundf(float val) 00005 { 00006 int whole_part = (int)val; 00007 float exp_part = whole_part + 0.5; 00008 if(val >= exp_part && val < whole_part + 1) 00009 return whole_part + 1; 00010 00011 return whole_part; 00012 }