confusing log equation! Help!!!

Hi, I need help! For the equation: total= pe^(r*t); I must put in my program how to find the 'r'.
I tried entering:
r*t= log(total/p)
r=(r*t)/t;

The compiler will not allow this. And I do not know what I need to do!!! Please help or give me a hint!

what is r*t? If you did the math, you get a number. On the other side of the = sign, you get a number. They should be the same, right? Well. Yes. That is math.

This is programming. In programming = sign does not mean left side is equal to right side (== sign means this in a way. But it checks to see if the left side equals the right side and spits out a true or false). The = sign is an assignment operator. So whatever is on the right side of the = sign is stored into the variable on the left side.

So. With this logic, you are trying to store a number inside a number. This does not make sense to me, and it doesn't make sense to the compiler. r=(r*t)/t is ok. Because r is a variable. But, r*t is not a variable, so r*t= log(total/p) will give an error.
Last edited on
I don't understand if your program is an equation solving program or if you just use the equation total= pe^(r*t) in your program.
sorry for the confustion; but I finnally got it! thank you !
Topic archived. No new replies allowed.