Java examples for java.lang:Math Algorithm
Math log based 2
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { double num = 2.45678; System.out.println(log2(num)); }/*w w w .j av a2s . c o m*/ public static double log2(double num) { return (Math.log(num) / Math.log(2)); } }