
* automated pandoc deploy * automated pandoc deploy (v2) * automated pandoc deploy (v2) * automated pdoc deploy (v3) * automated pdoc deploy (v4) * automated pdoc deploy (v5) * automated pdoc deploy (v5) * prepare for python project * 8-bit testing * 8-bit testing * 8-bit testing (v2) * 8-bit testing (v3) * update of sign
23 lines
423 B
C
23 lines
423 B
C
#include <assert.h>
|
|
#include <stdio.h>
|
|
#include <stdint.h>
|
|
|
|
int64_t CNAME(int64_t a, int64_t b);
|
|
|
|
|
|
int main() {
|
|
int result = 0;
|
|
for (int i = -128; i < 128; i++){
|
|
for (int j = -128; j < 128; j++){
|
|
result = i + j;
|
|
|
|
// Calculating 2's complement in case of negative sum
|
|
if (result < 0) {
|
|
result = 512 + result;
|
|
}
|
|
|
|
assert(result == (int)CNAME(i,j));
|
|
}
|
|
}
|
|
return 0;
|
|
} |