java code for logarithm
public static double log(double a)
java code for logarithm
public static double log(double a)
log java
// Java program to demonstrate working
// of java.lang.Math.log() method
import java.lang.Math;
class Gfg {
// driver code
public static void main(String args[])
{
double a = -2.55;
double b = 1.0 / 0;
double c = 0, d = 145.256;
// negative integer as argument, output NAN
System.out.println(Math.log(a));
// positive infinity as argument, output Infinity
System.out.println(Math.log(b));
// positive zero as argument, output -Infinity
System.out.println(Math.log(c));
// positive double as argument
System.out.println(Math.log(d));
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us