mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
d44fbafb48
git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@50363 c7de825b-a66e-492c-adef-691d508d4ae1
27 lines
630 B
C++
27 lines
630 B
C++
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
#include <assert.h>
|
|
|
|
#include <tokudb_math.h>
|
|
using namespace tokudb;
|
|
|
|
static void test(int length_bits) {
|
|
int64_t max = (1ULL << (length_bits-1)) - 1;
|
|
for (int64_t x = -max-1; x <= max; x++) {
|
|
for (int64_t y = -max-1; y <= max; y++) {
|
|
bool over;
|
|
int64_t n = int_add(x, y, length_bits, over);
|
|
printf("%lld %lld %lld %u\n", x, y, n, over);
|
|
}
|
|
}
|
|
}
|
|
|
|
int main(int argc, char *argv[]) {
|
|
if (argc > 1) {
|
|
for (int i = 1; i < argc; i++) {
|
|
test(atoi(argv[i]));
|
|
}
|
|
}
|
|
return 0;
|
|
}
|