[Pdx-pm] log base 10

darthsmily darthsmily at verizon.net
Thu Apr 8 22:15:35 CDT 2004


*coughpendanticcough*
;)

He didn't specify a language, so I thought I'd be a smart ass and toss 
out some basic code.



Tkil wrote:

>>>>>>"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.
>_______________________________________________
>Pdx-pm-list mailing list
>Pdx-pm-list at mail.pm.org
>http://mail.pm.org/mailman/listinfo/pdx-pm-list
>
>  
>




More information about the Pdx-pm-list mailing list