Aller au contenu

Mathc initiation/a18

Un livre de Wikilivres.


Sommaire

Installer et compiler ce fichier dans votre répertoire de travail.

c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
int main(void)
{
nb_Z a;

  do{  
  clrscrn();

  a = i_Z( 1, -3);

  printf("     a = "); p_Z(a,S3,P0,S3,P0); printf("\n\n");
  
  printf(" Re(a) = %8.1f \n",Re_Z(a));
  printf(" Im(a) = %8.1f \n\n\n",Im_Z(a));
  
  a = rE_Z(9999,1E-4);

  printf("     a = "); p_Z(a,S3,P4,S3,P4); printf("\n\n");
  
  printf(" Re(a) = %8.4f \n",Re_Z(a));
  printf(" Im(a) = %8.4f \n\n\n",Im_Z(a));
  
  } while(stop_w()); 

 return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */



Exemple de sortie écran :

     a =  +1 -3i 

 Re(a) =      1.0 
 Im(a) =     -3.0 


     a = +0.9830-0.0964i 

 Re(a) =   0.9830 
 Im(a) =  -0.0964 



 Press   return to continue
 Press X return to stop