Mathc complexes/Fichiers c : test01c

Un livre de Wikilivres.

Application

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

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

  srand(time(&t));
  
	do{
		
  	clrscrn();
  	
  	printf("                  x = %%+8.3e (3 for three digits after the point)\n\n");
  	
  	printf(" Scientific Notation :     %%+8.3e ... \"e\" \n\n");            
	
	printf(" r_E(999, 1E-0) : x = %+8.3e  -999. < x < 999.\n", r_E(999, 1E-0));
	printf(" r_E(999, 1E-1) : x = %+8.3e  -99.9 < x < 99.9\n", r_E(999, 1E-1));
	printf(" r_E(999, 1E-2) : x = %+8.3e  -9.99 < x < 9.99\n", r_E(999, 1E-2));
	printf(" r_E(999, 1E-3) : x = %+8.3e  -.999 < x < .999\n", r_E(999, 1E-3));


    }while(stop_w());
		
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Nous allons cette fois imprimer les nombres sous la forme scientifique. (+5.360e-01 = +0.5360)


Exemple de sortie écran :

                  x = %+8.3e (3 for three digits after the point)

 Scientific Notation :     %+8.3e ... "e" 

 r_E(999, 1E-0) : x = +9.520e+02  -999. < x < 999.
 r_E(999, 1E-1) : x = +8.800e+01  -99.9 < x < 99.9
 r_E(999, 1E-2) : x = -5.390e+00  -9.99 < x < 9.99
 r_E(999, 1E-3) : x = -5.170e-01  -.999 < x < .999

 Press return to continue
 Press X      to stop