[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Problemer med complex.h



Jeg sidder lige nu og forsoeger at faa C til at regne med komplekse tal
for mig, men jeg kan ikke rigtig faa det til at fungere, og haaber
derfor der er en eller anden der kan hjaelpe mig med det !!! ... Ind til
videre har jeg forsoegt mig med:

#include <complex.h>
#include <iostream.h>
#include <stdio.h>

void main() {
  double_complex c,cc,ccc;

  c = (3,1);
  cc = (2,4);
  ccc = c * cc;

  cout << c << " " << cc << " " << ccc << endl;
  cout << real(c) << " " << imag(c) << endl;

}

Hvilket giver outputtet:

(1,0) (4,0) (4,0)
1 0

Og det var jo ikke ligefrem det jeg regnede med at faa !!!

Saa hvad goer jeg forkert ???

Paa forhaand tak for hjælpen !!!

Dudde


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *