make all doubles as long double

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

View File

@ -47,7 +47,7 @@
* \param[in] x point at which to evaluate the polynomial * \param[in] x point at which to evaluate the polynomial
* \returns \f$f(x)\f$ * \returns \f$f(x)\f$
*/ */
long double complex poly_function(double *coeffs, unsigned int degree, long double complex poly_function(long double *coeffs, unsigned int degree,
long double complex x) long double complex x)
{ {
long double complex out = 0.; long double complex out = 0.;
@ -94,7 +94,7 @@ char check_termination(long double delta)
*/ */
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
double *coeffs = NULL; long double *coeffs = NULL;
long double complex *s0 = NULL; long double complex *s0 = NULL;
unsigned int degree = 0; unsigned int degree = 0;
unsigned int n, i; unsigned int n, i;
@ -108,8 +108,8 @@ int main(int argc, char **argv)
} }
degree = argc - 1; /* detected polynomial degree */ degree = argc - 1; /* detected polynomial degree */
coeffs = (double *)malloc( coeffs = (long double *)malloc(
degree * sizeof(double)); /* store all input coefficients */ degree * sizeof(long double)); /* store all input coefficients */
s0 = (long double complex *)malloc( s0 = (long double complex *)malloc(
(degree - 1) * (degree - 1) *
sizeof(long double complex)); /* number of roots = degree-1 */ sizeof(long double complex)); /* number of roots = degree-1 */