View Single Post
  #10   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Fri, 19 Nov 2004 09:07:10 -0500, "Dana DeLouis"
wrote:

Hi Ron. I really like your code. Works great. ;)
May I make an observation? In the following 3 lines...

CDec(Log(r) / Log(ToBase)
CDec(r - Digits(i) * ToBase ^ -i)
CDec(r + Temp2 * FromBase ^ j)

Although these show up as "Decimal", and perhaps with more than 15 digits,
I just want to point out that their "precision" will not be more than the
standard 15 digits. Excel doesn't support Log & "^" at this time. However,
it can still be an advantage to use CDec as your code does despite this
limitation.
As a side note, I have been stuck on a Log function for a long time. I've
have experimented with many algorithms and Series expansions, but nothing
that I'm really happy with. For equations of the form FromBase ^j, (j is
increased in a loop) the usual technique is to start with a separate
variable (say t) to hold this number, and on each pass in the
loop...t=t*FromBase. Or something similar.
Anyway, great code. Just thought I'd pass on an observation. ;)


Thank you for that observation. I appreciate it. I had fun researching it. I
had always wondered about the limitations of the ATP add-in with regard to
handling fractions on the conversions. So I learned something. And after
figuring out the basics, it was relatively simple to extend the algorithm to
include all the bases that could be represented by the alphabet :-).

It seems to me that when I was doing some basic testing, there were some
numbers that appeared to have more accurate results with CDec vs CDbl, but I
don't know enough about number (or computer) theory to be able to characterize
it any better than that statement. (self-taught).

Best,

--ron