Mathc complexes/Fichiers c : p m05
Apparence
Installer et compiler ce fichier dans votre répertoire de travail.
p_m05.c |
---|
/* ------------------------------------ */
/* Save as : p_m05.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int r, int c)
{
int Pn ;
double **A = rE_mZ(i_mZ(r,c),99999,1E-3);
for(Pn = P0; Pn<=P4; Pn++)
{
clrscrn();
printf(" P%d figures after the point\n\n",Pn);
printf(" A : \n" );
p_mZ(A, S12,Pn, S8,Pn, C3);
if(Pn!=P4)stop();
}
f_mZ(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
fun(rp_I(R5),rp_I(C5));
while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
La fonction p_mZ(); a quatre paramètres. Le troisième permet de contrôler le nombre de chiffres après la virgule.
Exemple de sortie écran :
0 figures after the point
A :
-9 +82i -77 -5i
-95 +9i +50 -10i
+86 -47i -46 -81i
-78 -43i +94 -56i
+8 -76i -83 -45i
Press return to continue.
1 figures after the point
A :
-8.7 +82.2i -76.8 -4.7i
-94.6 +9.5i +50.4 -9.7i
+86.5 -47.3i -45.7 -81.3i
-77.6 -42.8i +94.0 -56.2i
+8.3 -76.5i -83.2 -45.0i
Press return to continue.
2 figures after the point
A :
-8.74 +82.17i -76.83 -4.75i
-94.63 +9.46i +50.37 -9.70i
+86.45 -47.32i -45.71 -81.27i
-77.65 -42.84i +93.96 -56.16i
+8.28 -76.49i -83.19 -44.99i
Press return to continue.
3 figures after the point
A :
-8.737 +82.170i -76.829 -4.745i
-94.631 +9.460i +50.366 -9.703i
+86.450 -47.317i -45.713 -81.265i
-77.647 -42.837i +93.962 -56.159i
+8.282 -76.489i -83.189 -44.987i
Press return to continue.