From 2150c35846ac213a65b65e92346815d3910c7c99 Mon Sep 17 00:00:00 2001 From: Krishna Vedala <7001608+kvedala@users.noreply.github.com> Date: Wed, 1 Jul 2020 20:49:27 -0400 Subject: [PATCH] fix printing long double --- numerical_methods/durand_kerner_roots.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numerical_methods/durand_kerner_roots.c b/numerical_methods/durand_kerner_roots.c index ef9db916..0042e21d 100644 --- a/numerical_methods/durand_kerner_roots.c +++ b/numerical_methods/durand_kerner_roots.c @@ -147,9 +147,9 @@ int main(int argc, char **argv) { coeffs[n] = strtod(argv[n + 1], NULL); if (n < degree - 1 && coeffs[n] != 0) - printf("(%g) x^%d + ", coeffs[n], degree - n - 1); + printf("(%Lg) x^%d + ", coeffs[n], degree - n - 1); else if (coeffs[n] != 0) - printf("(%g) x^%d = 0\n", coeffs[n], degree - n - 1); + printf("(%Lg) x^%d = 0\n", coeffs[n], degree - n - 1); double tmp; if (n > 0)