Posts: 3,343
Threads: 83
Joined: Mar 2003
Say I want to work out 10^2.4 (which is 251+loose change). How do I work it out without using the x^y button on my calculator? I'm pretty sure I need logs, but how would I do it?
PS: I need a mathematical formula, series etc.
Posts: 1,956
Threads: 65
Joined: Jun 2003
ORACLE:
This may be what you're looking for:
Code:
N = A^X
therefore:
A = INT(LOG(X) * LOG(N))
X = INT(LOG(N) / LOG(A))
*****
Posts: 199
Threads: 2
Joined: May 2003
Or you could do: (with workings...)
10^2.4
=10^(12/5)
=10^2 · 10^(2/5)
=10^2 · (10^
(1/5))^2
=10^2 · (
5\/¯10)^2
=(10Ã10) · (
(5\/¯10)Ã
(5\/¯10))
Now you don't need to use the x^y button
url=http://www.spreadfirefox.com/?q=affiliates&id=60131&t=79]
[/url]
END OF LINE
.
Posts: 3,343
Threads: 83
Joined: Mar 2003
Not quite moneo... I want to not have to use the log function.
Phydaux's qth root of p^n is better for what I want. Now how do I calculate the 5th root of something in QBasic without using log functions etc? (This is for StatLib, so I have to rewrite every inbuilt function :roll: )
Posts: 1,166
Threads: 62
Joined: Apr 2003
am an asshole. Get used to it.
Posts: 199
Threads: 2
Joined: May 2003
Quote:Not quite moneo... I want to not have to use the log function.
Phydaux's qth root of p^n is better for what I want. Now how do I calculate the 5th root of something in QBasic without using log functions etc? (This is for StatLib, so I have to rewrite every inbuilt function :roll: )
This calculates integer
nth roots: (
n\/¯
i)
Code:
DIM n AS INTEGER
DIM a AS DOUBLE, b AS DOUBLE
i = 10 'where n is root, i is input
n = 5 '
a = 1
FOR j = 1 TO 10
b = (1 / n) * ((i / a ^ (n - 1)) + (n - 1) * a)
a = b
NEXT j
PRINT a
You've still got the exponent there, but integer exponents are simple
Also the more itterations the higher accuracy of depth you get.
HTH
~Phydaux
url=http://www.spreadfirefox.com/?q=affiliates&id=60131&t=79]
[/url]
END OF LINE
.
Posts: 1,166
Threads: 62
Joined: Apr 2003
You may not want to use i because in the math world, i is the square root of -1
am an asshole. Get used to it.
Posts: 4,307
Threads: 63
Joined: May 2003
I think he wants to know how to calculate 10^2.4 without using ^ on his calculator.
To use logs u must know this formula:
log[(m)^n] = nxlog(m)
So your calculation would be:
Antilog(2.4 x log(10))
Now if u take the log to the base 10 then it would be Antilog(2.4 x 1)...(As log 10 to the base 10 is 1)
Therefore,
Antilog(2.4) = 251.1886432
Ok?
Posts: 199
Threads: 2
Joined: May 2003
Quote:You may not want to use i because in the math world, i is the square root of -1
I feel perfectly happy using whatever letters I want.
i is also used for electric current, which is why engineers often use j to mean the square root of -1.
I have also clearly stated what i means so you shouldn't really get confused.
You, may, or may not have noticed that often for a FOR loop, the letter i is used to mean itteration. It's insane that the same symbol can mean different things eh?
url=http://www.spreadfirefox.com/?q=affiliates&id=60131&t=79]
[/url]
END OF LINE
.
Posts: 1,407
Threads: 117
Joined: Dec 2002
Quote:So your calculation would be:
2.4 x log(10)
In fact it would give the log of the result. The true result is
exp(2.4Xlog(10))
Antoni