mirror of
https://github.com/MariaDB/server.git
synced 2025-01-23 15:24:16 +01:00
98b46119e1
git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@54621 c7de825b-a66e-492c-adef-691d508d4ae1
29 lines
691 B
C++
29 lines
691 B
C++
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include <inttypes.h>
|
|
#include <stdlib.h>
|
|
#include <assert.h>
|
|
#include <sys/types.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("%"PRId64" %"PRId64" %"PRId64" %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;
|
|
}
|