Math.log1p() returns natural log value of input number +1 with base e.
Here are some examples with different type of numbers. For clarity natural log value is also shown.
System.out.println(Math.log(5));    //1.6094379124341003 
System.out.println(Math.log1p(4));    //1.6094379124341003
System.out.println(Math.log1p(0));    //0.0
System.out.println(Math.log1p(-1));   //-Infinity
System.out.println(Math.log(4.12));   //1.415853163361435
System.out.println(Math.log1p(3.12)); //1.415853163361435
The output is same where input is added by 1.

All Math functions

Post your comments , suggestion , error , requirements etc here

We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 All rights reserved worldwide Privacy Policy Disclaimer