2012-11-27 16:23:21 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdint.h>
|
2013-03-20 17:51:12 +01:00
|
|
|
#include <inttypes.h>
|
2012-11-27 16:23:21 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#include <tokudb_math.h>
|
|
|
|
using namespace tokudb;
|
|
|
|
|
|
|
|
static void test(int length_bits) {
|
|
|
|
printf("%s %d\n", __FUNCTION__, length_bits);
|
|
|
|
uint64_t max = (1ULL << length_bits) - 1;
|
|
|
|
for (uint64_t x = 0; x <= max; x++) {
|
|
|
|
for (uint64_t y = 0; y <= max; y++) {
|
|
|
|
bool over;
|
2012-12-10 20:37:47 +01:00
|
|
|
uint64_t n = uint_add(x, y, max, &over);
|
2013-03-20 17:51:12 +01:00
|
|
|
printf("%"PRIu64" %"PRIu64" %"PRIu64"\n", x, y, n);
|
2012-11-27 16:23:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
if (argc > 1) {
|
|
|
|
for (int i = 1; i < argc; i++) {
|
|
|
|
test(atoi(argv[i]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|