Mathc complexes/Fichiers c : p m07
Apparence
Installer et compiler ce fichier dans votre répertoire de travail.
p_m07.c |
---|
/* ------------------------------------ */
/* Save as : p_m07.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r,int rc,int c)
{
double **A = rE_mZ(i_mZ(r,rc), 99999, 1E-3);
double **B = rE_mZ(i_mZ(rc,c), 99999, 1E-3);
double **AB = i_mZ(r,c);
clrscrn();
printf(" A : ");
pE_mZ(A, S12,P2, S10,P2, C3);
printf(" B : ");
pE_mZ(B, S12,P2, S10,P2, C3);
printf(" AB : ");
pE_mZ(mul_mZ(A,B,AB), S12,P2, S10,P2, C3);
f_mZ(A);
f_mZ(B);
f_mZ(AB);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
fun(rp_I(R4),rp_I(RC4),rp_I(C4));
while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
La fonction pE_mZ(); est identique à la fonction p_mZ(); mais elle écrit les nombres de manière scientifique.
Exemple de sortie écran :
A :
-7.49e+01 +4.08e+01i -4.53e+01 -3.95e+01i +6.18e+01 +8.67e+00i
-8.04e+00 +4.73e+00i -2.73e+01 -1.56e+01i +3.84e+00 -1.66e+01i
-5.47e+00 -6.90e+01i -4.22e+00 -6.76e+01i +6.52e+01 -7.78e+01i
+8.12e+01 +3.12e+01i +4.21e+00 -3.36e+01i -3.78e+01 +9.10e+01i
B :
+1.74e+01 +9.57e+01i
+1.84e+01 -6.70e+01i
-3.43e+01 +8.72e+01i
AB :
-1.16e+04 +9.43e+02i
-8.21e+02 +1.76e+03i
+6.45e+03 +5.68e+03i
-1.04e+04 +9.88e+02i
Press return to continue
Press X to stop