Jul 15

The Math.log() method calculates natural logarithms. If you need to use base 2 then take the natural log and divide it by ln(2)

double log2 = Math.log(x) / Math.log(2);

written by objects \\ tags: , , ,


Leave a Reply

You must be logged in to post a comment.