Menu

#4 Arbitrary base logarithm

v1.0_(example)
open
nobody
log (1)
5
2016-04-24
2016-04-24
No

Is there a way to calculate arbitrary base logarithm and not just base 10 or e?

Discussion

  • arbitrary-dev

    arbitrary-dev - 2016-04-24

    Three words: change-of-base.
    Question closed.

     
    • (chongo) Landon Curt Noll

      Hello,

      As you may know, you can calculate the logarithm of x in base y by the following: ln(x)/ln(y).

      Currently we have, as you noted, two logarithm functons ln(x [, espilon]) and log(x [, epsilion]). Perhaps addiing 3rd function .. oh say call it logb(x, base [, epsilon]), where the 2nd base argument is required could return ln(x)/ln(base) for you.

      I'm not sure what the best name for this buildin function. Alas we cannot use ln() nor log() because today their 2nd argument, if given, is the epsilon error term. So maybe we can use lnb(x,base[,ep]) or maybe logb(x,base[,ep]) or ???

      chongo (Landon Curt Noll) /\oo/\

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.