Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Cant find log2() function??

Hi


I was trying to compile some source codebut it requires the use of a function log2(). I can only find log() and log10(). If anybody knows where it is how how to do log2 of a variable i would reaaly appreciate any help.


Thanks

Scott


Comments

  • >If anybody knows where it is how how to do log2 of a variable i would reaaly appreciate any help.


    OOooooh, basic math *grin*. Remember kids,

    loga(b) equals logc(b)/logc(a) for any c.

    (kinda easy to proof, to).


    so just do a log(x)/log(2) and you should be fine, wether you use the 10-log or the natural log.





Sign In or Register to comment.