Why am I getting inf as an output

I should be getting normal numbers, since I am just computing an interest rate.
[code]

float invContComp = (inInvest)*pow(2.71828,(intRate*numQuarter1));
cout<<"Value of your same investment but continously compounded is "<<invContComp<<" dollars.";
float profit2 = (invContComp-inInvest);
cout<<"Profit from this investment is "<<profit2<<" dollars.";
cout<<" "<<endl;
float difference = (profit2-profit);
cout<<"The difference between both investment types is "<<difference<<" dollars.";

This is my output
Value of your same investment but continously compounded is inf dollars.Profit from this investment is inf dollars.
The difference between both investment types is inf dollars.
Where and how are inInvest, intRate and numQuarter? And what values have been assigned to them?


I didn't want to show my whole code here, they are already initialized and their values are to be inputed by the user.
You need to show how those variables are declared and "initialized" because at least one of them are probably the problem.

int inInvest;
int intRate;
int numQuarter;

double numQuarter1 = (numQuarter/4.0);

I have to have quarters as an integer at first, then I make a new variables called numQuarter1 as a double.
I feel there is something wrong with my invContComp formula
Its supposed to be P*e^(r*t)
Make a debug output right before invContComp calculations. Tell what are values of inInvest, intRate and numQuarter1 right before calculation.
Topic archived. No new replies allowed.