help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] GSL_COMPLEX_ADD


From: Jon Drews
Subject: Re: [Help-gsl] GSL_COMPLEX_ADD
Date: Tue, 19 Jul 2005 10:04:19 -0600

On 7/19/05, Bruno Amizic <address@hidden> wrote:
> Hi,
> I am having problems using gsl on windows Visual Studio.
> I am able to use almost all functions. I linked libraries.
> However, I am having diffuculties using
> gsl_complex functions like:
> gsl_complex_add ... etc.
> 
> Please let me know if you can help me.

Bruno:

 Try this program and see if it works:
/* complexAdd.c Add two complex numbers. From chapter 5 (5.3).  */

#include <stdio.h>
#include <gsl/gsl_complex.h>
#include <gsl/gsl_complex_math.h>


int main()
{

  gsl_complex z1, z2, Z;

printf("Enter the first pair of complex numbers separated by a space
like so: a b\n");
scanf("%lf %lf", &z1.dat[0], &z1.dat[1]);

printf("Enter the second pair of complex numbers separated by a space
like so: c d\n");
scanf("%lf %lf", &z2.dat[0], &z2.dat[1]);

  Z = gsl_complex_add(z1, z2);

  printf("Answer = %.8lf  %.8lf\n", Z.dat[0], Z.dat[1]);

  return 0;
}


-- 
Kind regards,
Jonathan




reply via email to

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