Created
December 18, 2019 10:12
-
-
Save carousel/2a051f9b649e22685e1bc0b8ac9f11f5 to your computer and use it in GitHub Desktop.
calculate logarithm for any base in java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int num = 8; | |
int base = 2; | |
double log = Math.log(num) / Math.log(base); | |
System.out.println(log); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment