mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
9867e95233
git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@54539 c7de825b-a66e-492c-adef-691d508d4ae1
29 lines
692 B
C++
29 lines
692 B
C++
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include <inttypes.h>
|
|
#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;
|
|
uint64_t n = uint_add(x, y, max, &over);
|
|
printf("%"PRIu64" %"PRIu64" %"PRIu64"\n", x, y, n);
|
|
}
|
|
}
|
|
}
|
|
|
|
int main(int argc, char *argv[]) {
|
|
if (argc > 1) {
|
|
for (int i = 1; i < argc; i++) {
|
|
test(atoi(argv[i]));
|
|
}
|
|
}
|
|
return 0;
|
|
}
|