mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
better printing
This commit is contained in:
parent
ba5bd42cad
commit
51930feec2
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user