Math.log()
Math.log() returns natural log value of input number with base e.
Syntax
Math.log(input_number)
Here are some examples with different type of numbers.
System.out.println(Math.log(4)); //1.3862943611198906
System.out.println(Math.log(1)); //0.0
System.out.println(Math.log(0)); //-Infinity
System.out.println(Math.log(4.12));//1.415853163361435
Using negative input numbers
System.out.println(Math.log(-4.12)); //NaN
System.out.println(Math.log(-1)); //NaN
« All Math functions
« Java
This article is written by plus2net.com team.
plus2net.com