OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: complex.h under OpenBSD

From: Dave Feustel (dfeustelverizon.net)
Date: Fri Sep 02 2005 - 14:28:58 CDT


On Friday 02 September 2005 13:32, Otto Moerbeek wrote:
> On Fri, 2 Sep 2005, Ramiro Aceves wrote:
>
> > Hello dear OpenBSD fans.
> >
> > I am trying to compile a C program (Numerical Electromagnetics Code,
> > NEC, for antenna modelling) that needs complex numbers. I compiled it
> > with gcc on Linux with no special problems. It is an originaly fortran
> > written program that nowadays is translated into C for convenience.
> >
> > I used to work with "complex.h" header file on Linux, but I have not
> > been able to find the complex.h file on OpenBSD.
> >
> > In OpenBSD, I see that (as said in "info gcc") things like:
> >
> > _Complex float variable_name;
> > __real__ variable;
> > __imag__ variable;
> >
> > work perfectly.
> >
> > Do you know where can I get the complex.h file, or please can you point
> > me in the right direction? I am puzzled now.
==============
#include <complex>
#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
        complex<double> a(2.0,3.0);
        complex<double> b(4.0,4.0);
        complex<double> c;

        c = a*b;

        cout << c << endl;
        cout << a/b << endl;

        cout << pow(a,b) << endl;
        
        return 0;
}

=============

Davve Feustel
Tired of having to defend against Malware?
(You know: trojans, viruses, SPYWARE, ADWARE,
KEYLOGGERS, rootkits, worms and popups)
Then Switch to OpenBSD with a KDE desktop!!!