Subversion Repositories public

Rev

Rev 70 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 70 Rev 71
Line 901... Line 901...
901
 
901
 
902
// #$10100
902
// #$10100
903
int TRech::Ratenplan ()
903
int TRech::Ratenplan ()
904
{
904
{
905
	if (verzinsung == 0 || verzinsung == 2)
905
	if (verzinsung == 0 || verzinsung == 2)
-
 
906
	{
-
 
907
	   if (TpPars->effekt)
-
 
908
	   {
-
 
909
	   int i = 0;
-
 
910
	   int ret;
-
 
911
 
-
 
912
	      TpPars->effformel = TpPars->zssoll;
-
 
913
 
-
 
914
	      while (i < 10000 && (ret = DekursivPlan ()) == -2)
-
 
915
	      {
-
 
916
		 TpPars->zssoll = TpPars->effformel;
-
 
917
		 i++;
-
 
918
	      }
-
 
919
 
-
 
920
	      if (ret != -2)
-
 
921
		 return ret;
-
 
922
fprintf (stderr, "bzins: %.2f, ezins: %.2f\n", TpPars->gewicht, TpPars->ezins);
-
 
923
	      return 0;
-
 
924
	   }
-
 
925
 
906
	   return DekursivPlan ();
926
	   return DekursivPlan ();
-
 
927
	}
907
 
928
 
908
	return AntizipativPlan ();
929
	return AntizipativPlan ();
909
}
930
}
910
 
931
 
911
// #$10110
932
// #$10110
Line 1219... Line 1240...
1219
	   if (!TpPars->effekt)
1240
	   if (!TpPars->effekt)
1220
	   {
1241
	   {
1221
	      write (fd, &DTable, sizeof (DTABLE));
1242
	      write (fd, &DTable, sizeof (DTABLE));
1222
	      offset += (long)sizeof (DTABLE);
1243
	      offset += (long)sizeof (DTABLE);
1223
	   }
1244
	   }
1224
	   else if (DTable.datum > effend)
1245
	   else if (DTable.datum >= effend)
1225
	      break;
1246
	      break;
1226
	} /* end for */
1247
	} /* end for */
1227
 
1248
 
1228
	if (TpPars->fixrate == TRUE)
1249
	if (TpPars->fixrate == TRUE)
1229
	   TpPars->dbis = rat_dat[r_ind-1];
1250
	   TpPars->dbis = rat_dat[r_ind-1];
Line 1286... Line 1307...
1286
 
1307
 
1287
	      if (DTable.kz == 'R')
1308
	      if (DTable.kz == 'R')
1288
		 zins += DTable.zinsen;
1309
		 zins += DTable.zinsen;
1289
	   }
1310
	   }
1290
 
1311
 
1291
	   TpPars->effformel = 100.0 - (100.0 / TpPars->ezins * zins);
1312
	   if ((TpPars->ezins - 0.1) < zins && (TpPars->ezins + 0.1) > zins)
-
 
1313
	   {
-
 
1314
	      tmpFile.close();
-
 
1315
	      TpPars->gewicht = zins;
-
 
1316
	      return 0;
-
 
1317
	   }
-
 
1318
	   else
-
 
1319
	   {
-
 
1320
	      tmpFile.close();
-
 
1321
	      TpPars->gewicht = zins;
-
 
1322
 
-
 
1323
	      if (TpPars->ezins < zins)
-
 
1324
		 TpPars->effformel += 0.0001;
-
 
1325
	      else
-
 
1326
		 TpPars->effformel -= 0.0001;
-
 
1327
 
-
 
1328
	      return -2;		// Für nächste Iteration präparieren.
-
 
1329
	   }
1292
	}
1330
	}
1293
 
1331
 
1294
	tmpFile.close ();
1332
	tmpFile.close ();
1295
	return 0;
1333
	return 0;
1296
}
1334
}