Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Linear Algebra and the C Language/a0it

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

__NOTOC__ Install and compile this file in your working directory. /* ------------------------------------ */ /* Save as : c00d.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ /* ------------------------------------ */ double **X_rEp_mR( double **A, int n, double e /* 1E-1 1E-0 1E+1 */ ) { int r; int c; for (r=R1; r<A[R_SIZE][C0]; r++) for (c=C1; c<A[C_SIZE][C0]; c++) A[r][c] = rp_E(n,e); return(A); } /* ------------------------------------ */ /* ------------------------------------ */ void fun(int r, int c) { double **A = rEp_mR(i_mR(r,c), 999, 1E-0); double **B = rEp_mR(i_mR(r,c), 999, 1E-1); double **C = rEp_mR(i_mR(r,c), 999, 1E-2); double **D = rEp_mR(i_mR(r,c), 999, 1E-3); clrscrn(); printf("rEp_mR() : Positive decimal numbers\n\n"); printf(" A: xxx rE_mR(A,999,1E-0);"); p_mR(A, S10,P0,C6); printf(" B: xx.x rE_mR(B,999,0.1E-1);"); p_mR(B, S10,P1,C6); stop(); clrscrn(); printf(" C: x.xx rE_mR(C,999,1E-2);"); p_mR(C, S10,P2,C6); printf(" D: x.xxx rE_mR(D,999,1E-3);"); p_mR(D, S10,P3,C6); f_mR(A); f_mR(B); f_mR(C); f_mR(D); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do fun(rp_I(R4),rp_I(C6)); while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: rEp_mR() : Positive decimal numbers A: xxx rE_mR(A,999,1E-0); +118 +786 +265 +351 +681 +225 +938 +555 +656 B: xx.x rE_mR(B,999,0.1E-1); +71.8 +45.2 +6.0 +31.6 +31.7 +12.1 +63.6 +28.0 +0.3 Press return to continue. C: x.xx rE_mR(C,999,1E-2); +8.22 +7.24 +6.91 +3.27 +4.39 +7.92 +3.21 +6.45 +5.50 D: x.xxx rE_mR(D,999,1E-3); +0.167 +0.053 +0.708 +0.712 +0.170 +0.495 +0.695 +0.520 +0.894 Press return to continue Press X return to stop