fix printing long double

This commit is contained in:
Krishna Vedala 2020-07-01 20:49:27 -04:00
parent cb999259cf
commit 2150c35846
No known key found for this signature in database
GPG Key ID: BA19ACF8FC8792F7

View File

@ -147,9 +147,9 @@ int main(int argc, char **argv)
{ {
coeffs[n] = strtod(argv[n + 1], NULL); coeffs[n] = strtod(argv[n + 1], NULL);
if (n < degree - 1 && coeffs[n] != 0) 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) 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; double tmp;
if (n > 0) if (n > 0)