Java Onlines
Java Sandbox
Java Benchmark
Math
String
Python Sandbox
PHP Sandbox
Java Sandbox
Java Benchmark
Math
String
Python Sandbox
PHP Sandbox
Online Java pow() function
pow
- Returns the value of x to the power of y
Title
public class Main { public static void main(String[] args) { double x = 28; double y = 4; // return the maximum of two numbers System.out.println("Maximum number of x and y is: " +Math.max(x, y)); // return the square root of y System.out.println("Square root of y is: " + Math.sqrt(y)); //returns 28 power of 4 i.e. 28*28*28*28 System.out.println("Power of x and y is: " + Math.pow(x, y)); // return the logarithm of given value System.out.println("Logarithm of x is: " + Math.log(x)); System.out.println("Logarithm of y is: " + Math.log(y)); // return the logarithm of given value when base is 10 System.out.println("log10 of x is: " + Math.log10(x)); System.out.println("log10 of y is: " + Math.log10(y)); // return the log of x + 1 System.out.println("log1p of x is: " +Math.log1p(x)); // return a power of 2 System.out.println("exp of a is: " +Math.exp(x)); // return (a power of 2)-1 System.out.println("expm1 of a is: " +Math.expm1(x)); } }
Run on Java version:
14
14.0.1
14
13
13.0.2
13.0.1
13
12
12.0.2
12.0.1
12
11
11.0.7
11.0.6
11.0.5
11.0.4
11.0.3
11.0.2
11.0.1
11
10
10.0.2
10.0.1
10
9
9.0.4
9.0.1
9
8
8
7
7
6
6
Execute Code
Math Functions
abs
acos
asin
atan
atan2
cbrt
ceil
copySign
cos
cosh
exp
expm1
floor
getExponent
hypot
IEEEremainder
log
log10
log1p
max
min
nextAfter
nextUp
pow
random
rint
round
signum
sin
sinh
sqrt
tan
tanh
toDegrees
toRadians
ulp