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

Post Code on Blogger

Simplest way to post code to blogger for me: <pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black;overflow-x:...