2 Replies Latest reply on Sep 8, 2010 12:49 AM by jack182

    log10

    jack182 Level 1

      Hello,

       

      I am just wondering if there is a nice advanced actionscript API for Math class? I am looking for log10 of a number. The Math.log gives different result. Any idea or example?

       

      Thanks a lot.

      cheers.

        • 1. Re: log10
          Shongrunden Adobe Employee

          The ASDoc for the Math.LOG10E constant suggests that "The Math.log() method computes the natural logarithm of a number. Multiply the result of Math.log() by Math.LOG10E to obtain the base-10 logarithm."

           

          trace("log10(x)=",Math.log(x) * Math.LOG10E);

           

          There is also a Math.LOG2E constant if you want log base 2.  For other bases it might help to remember that logx(y) = ln(y) / ln(x)

          1 person found this helpful
          • 2. Re: log10
            jack182 Level 1

            Hi,

             

            thanks for the help