xp_comm_proj/gnrlhist/genhisto.c
/* returns the integral value closest to the real */
returns the integral value closest to the real
returns the integral value closest to the real
double closest(double real_val){
   if ( fabs(real_val - ceil(real_val)) > fabs(real_val - floor(real_val)) ) 
         return floor(real_val);
    else return ceil(real_val);
}
double closest ( double real_val ) { if ( fabs ( real_val - ceil ( real_val ) ) > fabs ( real_val - floor ( real_val ) ) ) return floor ( real_val ) ; else return ceil ( real_val ) ; }
returns the integral value closest to the real
returns the integral value closest to the real