2011-03-29

Get Rounding of A of B

#define DIVIDE_ROUNDUP(a,b) (((a)+((b)-1))/(b))
// return a/b rounding up to the next digital

#define ROUNDUP(a,b) (ROUNDUP_DIVIDE(a,b)*(b))
// return rounding of a to the closest multiple of b

No comments:

Post a Comment