Mathc matrices/Fichiers c : test01e


Fonctions de bases


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

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

  srand(time(&t));
  
	do{
		
  	clrscrn();
  	
  	printf("                  x = %%+8.3e (+ with the sign)\n\n"); 
  	
    printf(" Scientific Notation :     %%+8.3E ... \"e\" or \"E\" \n\n");             
	
	printf(" r0_E(999, 1E-0) : x = %+8.3e  -999. < x < 999.\n", r0_E(999, 1E-0));
	printf(" r0_E(999, 1E-1) : x = %+8.3e  -99.9 < x < 99.9\n", r0_E(999, 1E-1));
	printf(" r0_E(999, 1E-2) : x = %+8.3e  -9.99 < x < 9.99\n", r0_E(999, 1E-2));
	printf(" r0_E(999, 1E-3) : x = %+8.3e  -3    < x < 3\n", r0_E(  3, 1E-3));

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


La fonction r_E(); avec la possibilité d'avoir des zéros.


Exemple de sortie écran :

                  x = %+8.3e (+ with the sign)

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

 r0_E(999, 1E-0) : x = +9.290e+02  -999. < x < 999.
 r0_E(999, 1E-1) : x = +8.360e+01  -99.9 < x < 99.9
 r0_E(999, 1E-2) : x = -6.450e+00  -9.99 < x < 9.99
 r0_E(999, 1E-3) : x = +0.000e+00  -3    < x < 3

 Press return to continue
 Press X      to stop