/* PROJEKT Kettenbruch Seite */ /* Speichermodell = small */ /* Kettenbruchzerlegung */ /*-----------------------------------------------------------------------*/ #include #include #include #include #include main(void) { // double PI = 3.141592653589793238462643; double PI = 3.14159265359; int N ; /* Entwicklungstiefe */ double z ; /* INPUT */ double target; /* kopie dto */ double zf ; /* frac(INPUT) */ int zi ; /* int (INPUT) */ double a[100]; /* Kettenbruchkoeffizienten */ double z0,n0,z1,n1; /* Rekursive Brueche */ int i ; clrscr(); N=10; /*******************************************************/ /* 1) ANALYSE Umwandlung Zahl in Kettenbruch */ /*******************************************************/ z=PI; /* zu analysierende Zahl */ z=(sqrt(5)-1)/2.0; target=z; printf("Kettenbruchzerlegung\n"); printf("---------------------\n"); printf("target: %lf\n",z); for (i=0; i