[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] problems w/ gsl_poly_solve_quadratic

From: Jon Drews
Subject: Re: [Help-gsl] problems w/ gsl_poly_solve_quadratic
Date: Tue, 13 Jul 2004 19:15:06 -0500

Hi Giulio:

 It worked! It compiles and runs fine. I just need to find out why the
declaration as
pointers, double *x0, *x1;, failed to work. Is it becasue the did not
have space allocated for them? I also tried intializing them to zero
but that caused the progam to crash right away.

On Tue, 13 Jul 2004 08:13:36 +0200, G1ul10 <address@hidden> wrote:
> Try this instead:
> #include "stdio.h"
> #include <gsl/gsl_poly.h>
> int main()
> {
>   double a, b, c, x0,x1;
>   printf("Enter the coefficients a, b, c of ax^2 + b*x + c = 0\n");
>   scanf("%lf %lf %lf", &a, &b, &c);
>   gsl_poly_solve_quadratic(a, b, c, &x0, &x1);
>   printf("The roots are: %lf, %lf\n", x0, x1);
>   return 0;
> }
> it should work. See the difference?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]