Java Code for Negative Log

This java programming code is used to find the negative log. You can select the whole java code by clicking the select option and can use it. When you click text, the code will be changed to text format. This java program code will be opened in a new pop up window once you click pop-up from the right corner. You can just copy, paste this java code and use it to find the negative log.

import java.util.*;
import java.lang.*;
class NegativeLog
{  
    public static void main(String args[])
    {
        Scanner in = new Scanner(System.in);
        double r,x=12,logBase2,logBase10,logBasEe;
        logBase10 = Math.log(1.0/x)/Math.log(10);
        logBase2 = Math.log(1.0/x)/Math.log(2);
        logBasEe = Math.log(1.0/x)/Math.log(2.71828183) ;
        System.out.println("Negative Log of x for base 10  = "+logBase10);
        System.out.println("\nNegative Log of x for base 2  = "+logBase2);
        System.out.println("\nNegative Log of x for base e  = "+logBasEe);
    }
}
Other Programming Codes
Online Calculator : Negative Log
Click on the select code link to copy and paste this free java program code for negative log.

english Calculators and Converters

Ask a Question


Sitemap