aboutsummaryrefslogtreecommitdiff
path: root/puzzles.h
diff options
context:
space:
mode:
Diffstat (limited to 'puzzles.h')
-rw-r--r--puzzles.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/puzzles.h b/puzzles.h
index cbe7f88..2f49613 100644
--- a/puzzles.h
+++ b/puzzles.h
@@ -18,6 +18,9 @@
#define STR_INT(x) #x
#define STR(x) STR_INT(x)
+/* An upper bound on the length of sprintf'ed integers (signed or unsigned). */
+#define MAX_DIGITS(x) (sizeof(x) * CHAR_BIT / 3 + 2)
+
/* NB not perfect because they evaluate arguments multiple times. */
#ifndef max
#define max(x,y) ( (x)>(y) ? (x) : (y) )