Fixed the no output when given a pair that cannot be computed. Also added more debug information.
Stergios Upload Compile Checker / Explore-Gitea-Actions (push) Successful in 4s
Stergios Upload Compile Checker / Explore-Gitea-Actions (push) Successful in 4s
This commit is contained in:
4 files changed
+150
-16
No files matched your search
+11
-5
@@ -138,10 +138,10 @@ int main() {
|
||||
}
|
||||
|
||||
if (a0 == 0 || b0 == 0 || c0 == 0) {
|
||||
printf("Already zero present: (");
|
||||
print_int128(a0); printf(", ");
|
||||
print_int128(b0); printf(", ");
|
||||
print_int128(c0); printf(")\n");
|
||||
fprintf(f_output, "Already zero present: (");
|
||||
fprint_int128(f_output, a0); fprintf(f_output, ", ");
|
||||
fprint_int128(f_output, b0); fprintf(f_output, ", ");
|
||||
fprint_int128(f_output, c0); fprintf(f_output, ")\n");
|
||||
return 0;
|
||||
}
|
||||
int128_t gcd = gcd3(a0, b0, c0);
|
||||
@@ -153,7 +153,13 @@ int main() {
|
||||
solve(&sum, gcd, a, b, c, print_mode, f_output);
|
||||
} else if (mode == 2) {
|
||||
clear_global_table(); /* Reset unique root tracker */
|
||||
int32_t p = 7;
|
||||
char* line = prompt_line("Choose what exponential you want to use: ");
|
||||
if (!line) {
|
||||
fprintf(stderr, "Input error.\n");
|
||||
return 1;
|
||||
}
|
||||
int32_t p = atoi(line);
|
||||
free(line);
|
||||
int32_t exponents[3] = {2*p + 2, p, p};
|
||||
int128_t values[3] = {4 * power(a0, p) * power(b0, p), power(a0, p), power(b0, p)};
|
||||
generate_factor_pairs(&sum, 0, exponents, values, 1, print_mode, f_output);
|
||||
|
||||
Reference in new issue
Block a user