Subversion Repositories public

Compare Revisions

Ignore whitespace Rev 70 → Rev 71

/tilgungsplan/trunk/src/tilgrech.cpp
903,7 → 903,28
int TRech::Ratenplan ()
{
if (verzinsung == 0 || verzinsung == 2)
{
if (TpPars->effekt)
{
int i = 0;
int ret;
 
TpPars->effformel = TpPars->zssoll;
 
while (i < 10000 && (ret = DekursivPlan ()) == -2)
{
TpPars->zssoll = TpPars->effformel;
i++;
}
 
if (ret != -2)
return ret;
fprintf (stderr, "bzins: %.2f, ezins: %.2f\n", TpPars->gewicht, TpPars->ezins);
return 0;
}
 
return DekursivPlan ();
}
 
return AntizipativPlan ();
}
1221,7 → 1242,7
write (fd, &DTable, sizeof (DTABLE));
offset += (long)sizeof (DTABLE);
}
else if (DTable.datum > effend)
else if (DTable.datum >= effend)
break;
} /* end for */
 
1288,7 → 1309,24
zins += DTable.zinsen;
}
 
TpPars->effformel = 100.0 - (100.0 / TpPars->ezins * zins);
if ((TpPars->ezins - 0.1) < zins && (TpPars->ezins + 0.1) > zins)
{
tmpFile.close();
TpPars->gewicht = zins;
return 0;
}
else
{
tmpFile.close();
TpPars->gewicht = zins;
 
if (TpPars->ezins < zins)
TpPars->effformel += 0.0001;
else
TpPars->effformel -= 0.0001;
 
return -2; // Für nächste Iteration präparieren.
}
}
 
tmpFile.close ();