R
Rechtfertigung
Guest
I have a function that calculates the monthly payments needed to pay off a loan however when ever I try to run the program, I get this error, "E2140 expression must have integral or unscoped enum type". I think it has something to do with the mismatch of ints and floats in the expression. However if that is the case, why would it cause an error if the number being calculated is being stored into MonthlyPayment which is of type float.
float CalculatePeriodicPayment(float LoanAmount, int Years, float Interest)
{
int Months = 12;
float MonthlyPayment;
float I = (Interest / Months);
MonthlyPayment = ((LoanAmount * I) / (1 - (1 + I)) ^ -Months * Years); //Line Error is thrown
return MonthlyPayment;
}
Recht
Continue reading...
float CalculatePeriodicPayment(float LoanAmount, int Years, float Interest)
{
int Months = 12;
float MonthlyPayment;
float I = (Interest / Months);
MonthlyPayment = ((LoanAmount * I) / (1 - (1 + I)) ^ -Months * Years); //Line Error is thrown
return MonthlyPayment;
}
Recht
Continue reading...