diff options
Diffstat (limited to 'nacl/inttypes/unsigned.h')
-rw-r--r-- | nacl/inttypes/unsigned.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/nacl/inttypes/unsigned.h b/nacl/inttypes/unsigned.h new file mode 100644 index 00000000..31a7a6ea --- /dev/null +++ b/nacl/inttypes/unsigned.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #define DOIT(bits,target) \ | ||
2 | int main() \ | ||
3 | { \ | ||
4 | target x; \ | ||
5 | int i; \ | ||
6 | \ | ||
7 | x = 1; \ | ||
8 | for (i = 0;i < bits;++i) { \ | ||
9 | if (x == 0) return 100; \ | ||
10 | x += x; \ | ||
11 | } \ | ||
12 | if (x != 0) return 100; \ | ||
13 | x -= 1; \ | ||
14 | if (x < 0) return 100; \ | ||
15 | \ | ||
16 | return 0; \ | ||
17 | } | ||