/** Version text used by various commands if -V switch was given. */
#define VERSION_TEXT(prefix) "para_" prefix " " PACKAGE_VERSION \
" (" GIT_VERSION ": " CODENAME ")" "\n" \
- "Copyright (C) 2010 Andre Noll\n" \
+ "Copyright (C) 2011 Andre Noll\n" \
"This is free software with ABSOLUTELY NO WARRANTY." \
" See COPYING for details.\n" \
"Written by Andre Noll.\n" \
return ((max + 0.0) * (random() / (RAND_MAX + 1.0)));
}
+/** Round up x to next multiple of y. */
+#define ROUND_UP(x, y) ({ \
+ const typeof(y) _divisor = y; \
+ ((x) + _divisor - 1) / _divisor * _divisor; })
+
+/** Round down x to multiple of y. */
+#define ROUND_DOWN(x, y) ({ \
+ const typeof(y) _divisor = y; \
+ (x) / _divisor * _divisor; })
+
/** Divide and round up to next integer. */
#define DIV_ROUND_UP(x, y) ({ \
typeof(y) _divisor = y; \