thx
anthony
I think the key is... learning Maths ;-)
ln N
log N= --------
2 ln 2
Raul
Base on y register
Expression on x register
<< LOG SWAP LOG / EVAL >> LOGG ENTER STO
Press VAR. There you go!
Aaron
I don't feel so bad now -- the TI-89/92+ discussion group is not the
only one with such posts ;-)
Anyway, to answer the question, log_base_b(a) = ln(a)/ln(b). Of course
it should be easy to create a user-defined function for log_base_2(x).
Oh, I just noticed "uiuc" in Anthony's e-mail address... so we're
neighbors (I live in Champaign as well).
--
Bhuvanesh
I mean
<< LN SWAP LN / EVAL >> LOGG ENTER STO
Soryy!
Both programs work
Raul
LN 2 LN /
-Joe-
RPN program: \<< LN SWAP LN SWAP RATIO \>>
ALG program: \<< \-> L B 'LN(L)/LN(B)' \>>
both: NumberTarget NumberBase --> NumberResult or SymbolicExpression
they are controlled by flags -2 and -3, I guess
I hopr this helps :)
Joe's solutions are very concise and elegant as always. That'll do for the
particular base 2 log he asked for. What about this general solution inspired
by Joe's?
LN XROOT LN
(Number and base assumed to be on level Y and X, respectively).
Regards,
Gerson.
> LN XROOT LN
>
> (Number and base assumed to be on level Y and X, respectively).
Wow, very cool! I've never seen that before!
Much nicer then LN SWAP LN SWAP /.
And LN XROOT LN is even more accurate too, at least for these powers of 2,
log base 2: 16, 19, 21, 24, 26, 29, 31, 34, 36, 39... and less accurate for
no powers of 2 below 40. It doesn't fare so well on powers of 3, log base
3. How would one go about determining which rutine is more accurate in
general?
-jkh-
"Aaron Toponce" <top8...@yahoo.com> wrote in message
news:81f1e5dc.02111...@posting.google.com...
> I mean
> << LN SWAP LN / EVAL >> LOGG ENTER STO
> Soryy!
Don't be *soryy*, it's equivalent:
LOG(x) = ln(x)/ln(10)
so LOG(x)/LOG(y)=(ln(x)/ln(10))/(ln(y)/ln(10))=ln(n)/ln(y)
Jean-Yves
>Gerson W Barbosa wrote:
>
>> LN XROOT LN
>>
>> (Number and base assumed to be on level Y and X, respectively).
>
>Wow, very cool! I've never seen that before!
>
Thanks. Neither had I, Joe!
>Much nicer then LN SWAP LN SWAP /.
>
>And LN XROOT LN is even more accurate too, at least for these powers of 2,
>log base 2: 16, 19, 21, 24, 26, 29, 31, 34, 36, 39... and less accurate for
>no powers of 2 below 40. It doesn't fare so well on powers of 3, log base
>3. How would one go about determining which rutine is more accurate in
>general?
>
The logarithm of "N" to base "b" may be calculated as
(lnN)/(lnb)
which is equivalent to
ln [N^(1/lnb)] (applying one of the Laws of Logarithms)
or in the HP48 notation:
'LN(XROOT(LN(b),N))'
The drawback is a decrease in execution time (some scores of microseconds)
because the XROOT operation requires at least one LN and one EXP calculation.
As of the accuracy, I think is quite acceptable though I have not thought
about.
Now, honestly, I discovered this by chance, playing with the calculator. I was
trying to obtain a shorter program when I tried these three strokes.
Gerson.
>Gerson W Barbosa wrote:
>
>> LN XROOT LN
>>
>> (Number and base assumed to be on level Y and X, respectively).
>
>Wow, very cool! I've never seen that before!
>
Thanks. Neither had I, Joe!
>Much nicer then LN SWAP LN SWAP /.
>
>And LN XROOT LN is even more accurate too, at least for these powers of 2,
>log base 2: 16, 19, 21, 24, 26, 29, 31, 34, 36, 39... and less accurate for
>no powers of 2 below 40. It doesn't fare so well on powers of 3, log base
>3. How would one go about determining which rutine is more accurate in
>general?
>
The logarithm of "N" to base "b" may be calculated as
(lnN)/(lnb)
which is equivalent to
ln [N^(1/lnb)] (applying one of the Laws of Logarithms)
or in the HP48 notation:
'LN(XROOT(LN(b),N))'
The drawback is a increase in running time - it would take about twice as much
time to run - because the XROOT operation requires at least one LN and one EXP
calculation.
As of the accuracy, I think is quite acceptable though I have not thought
about it.
The base of the log being used doesn't matter
ln(x)/ln(y) is the same as log10(x)/log10(y) is the same as
logN(x)/logN(y).
A bientot
Paul
--
Paul Floyd http://paulf.free.fr (for what it's worth)
What happens if you have lead in your pants as well as lead in your pencil?