Mathc matrices/Fichiers c : test01c


Fonctions de bases


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

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

  srand(time(&t));
  
	do{
		
  	clrscrn();
  	
  	printf("                  x = %%+8.3f (8 for eight spaces for the number)\n\n");            
	
	printf(" r_E(999, 1E-0) : x = %+8.3f  -999. < x < 999.\n", r_E(999, 1E-0));
	printf(" r_E(999, 1E-1) : x = %+8.3f  -99.9 < x < 99.9\n", r_E(999, 1E-1));
	printf(" r_E(999, 1E-2) : x = %+8.3f  -9.99 < x < 9.99\n", r_E(999, 1E-2));
	printf(" r_E(999, 1E-3) : x = %+8.3f  -.999 < x < .999\n", r_E(999, 1E-3));


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


Cette fois nous allons générer des nombres avec des virgules.


Exemple de sortie écran :

                  x = %+8.3f (8 for eight spaces for the number)

 r_E(999, 1E-0) : x = +170.000  -999. < x < 999.
 r_E(999, 1E-1) : x =  +64.000  -99.9 < x < 99.9
 r_E(999, 1E-2) : x =   -6.930  -9.99 < x < 9.99
 r_E(999, 1E-3) : x =   -0.381  -.999 < x < .999

 Press return to continue
 Press X      to stop