Aller au contenu

Mathc matrices/Fichiers c : test01d

Un livre de Wikilivres.
Version datée du 16 avril 2020 à 10:02 par DannyS712 (discussion | contributions) (<source> -> <syntaxhighlight> (phab:T237267))


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

test01d.c
/* ------------------------------------ */
/*  Save as :   test01d.c               */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------	*/
int main(void)
{
time_t t;

  srand(time(&t));
  
	do{
		
  	clrscrn(); 

  	printf("                    x = %%+12.3e \n\n");          
  	  	
	printf(" r_E(99999, 1E-0) : x = %+12.3e \n", r_E(99999, 1E-0));
	printf(" r_E(99999, 1E-1) : x = %+12.3e \n", r_E(99999, 1E-1));
	printf(" r_E(99999, 1E-2) : x = %+12.3e \n", r_E(99999, 1E-2));
	printf(" r_E(99999, 1E-3) : x = %+12.3e \n", r_E(99999, 1E-3));
	printf(" r_E(99999, 1E-4) : x = %+12.3e \n", r_E(99999, 1E-4));
	printf(" r_E(99999, 1E-5) : x = %+12.3e \n", r_E(99999, 1E-5));
	printf(" r_E(99999, 1E-6) : x = %+12.3e \n", r_E(99999, 1E-6));           
	
    }while(stop_w());
		
  return 0;
}


Nous allons cette fois imprimer les nombres sous la forme scientifique.


Exemple de sortie écran :

                    x = %+12.3e 

 r_E(99999, 1E-0) : x =   -7.446e+04 
 r_E(99999, 1E-1) : x =   +9.615e+03 
 r_E(99999, 1E-2) : x =   -1.662e+02 
 r_E(99999, 1E-3) : x =   -1.835e+01 
 r_E(99999, 1E-4) : x =   -3.185e+00 
 r_E(99999, 1E-5) : x =   +9.455e-01 
 r_E(99999, 1E-6) : x =   -3.119e-03 

 Press return to continue
 Press X      to stop