[Pdx-pm] log base 10
Tkil
tkil at scrye.com
Thu Apr 8 18:10:46 CDT 2004
>>>>> "DS" == darthsmily <darthsmily at verizon.net> writes:
DS> Log10 = Log(number) / 2.30258509299405
For the people who wonder where the magic number comes from: the
logarithm of x in base b can be calculated by dividing the natural log
of x by the natural log of b. In formula form (so far as ascii art
allows):
ln x
log x = ----
b ln b
I don't remember enough math to tell you what the appropriate domains
would be, but for simple calculations, this should be sufficient.
In this case, b is 10, so we have
log10(x) = ln(x) / ln(10)
And ln(10) is 2.30258509299404568402, at least according to M_LN10 in
/usr/include/math.h. :)
t.
More information about the Pdx-pm-list
mailing list