better printing

This commit is contained in:
Krishna Vedala 2020-04-08 21:21:32 -04:00
parent ba5bd42cad
commit 51930feec2
No known key found for this signature in database
GPG Key ID: BA19ACF8FC8792F7

View File

@ -59,7 +59,7 @@ int main(int argc, char **argv)
}
double r = creal(root);
double c = cimag(root);
double c = fabs(cimag(root)) < accuracy ? 0 : cimag(root);
printf("Iter %5lu: Root: %4.4g%c%4.4gi\t\tdelta: %.4g\n", counter, r,
c >= 0 ? '+' : '-', c >= 0 ? c : -c, delta);