January 12th, 2000, 08:58 PM
i am first going to explain it. It is a program to solve an equation A^X=B, where the user gives A and B. So, this can solve 3 ^ X = 5, without using logarthmic functions. There is a way to do this:
On paper, it is set up like this: (nothing to do with division solving)
_1.___________
3 )5.0000000000
See that 3^1 is the lowest whole number digit below 5 (3^2 is 9, above 5.)
Then you:
1._______
3 )5.0000000
/3^10
You take 5, divide it by 3, and put that to the power of 10 [(5/3)^10]. In this case, it is about 165. Now you repeat the process, this time with 165. You see that 3^4 is the closest whole number before 165, 3^5 is above it. So you add in 4, then do [(165/(3^4))^10], and continue...
Now here is my question, and it is a tough one:
How can I do that in VB code? I have used a do-loop statement, but no luck so far... Word of advice: the correct answer should be 1.462...
On paper, it is set up like this: (nothing to do with division solving)
_1.___________
3 )5.0000000000
See that 3^1 is the lowest whole number digit below 5 (3^2 is 9, above 5.)
Then you:
1._______
3 )5.0000000
/3^10
You take 5, divide it by 3, and put that to the power of 10 [(5/3)^10]. In this case, it is about 165. Now you repeat the process, this time with 165. You see that 3^4 is the closest whole number before 165, 3^5 is above it. So you add in 4, then do [(165/(3^4))^10], and continue...
Now here is my question, and it is a tough one:
How can I do that in VB code? I have used a do-loop statement, but no luck so far... Word of advice: the correct answer should be 1.462...