Java Math.round() method21 Mar 2025 | 2 min read The java.lang.Math.round() is used round of the decimal numbers to the nearest value. This method is used to return the closest long to the argument, with ties rounding to positive infinity. SyntaxParameterReturn
Example 1Output: 80 Example 2Output: -84 Example 3Output: -9223372036854775808 Example 4Output: 9223372036854775807 Example 5Output: 0 Next TopicJava Math |
Java method The java.lang.Math.signum () is used to find the sign of a given value. Syntax public static double signum(double x) public static float signum(float x) Parameter x = It is a floating-point value whose signum is to be returned Return This method returns the signum function of an argument If the...
1 min read
Java Math.Up() Method The java.lang.Math.Up() is a inbuilt math method in java. It returns the floating-point value adjacent to the user specified parameter (d) in the direction of positive infinity. This method is equivalent to After(d, Double.POSITIVE_INFINITY) method. Implementation of Up may run faster than its equivalent...
2 min read
Java method The java.lang. is used to return the square root of a number. Syntax public static double sqrt(double x) Parameter x= a value Return This method returns the square root of x. If the argument is positive double value, this method will return the square root of a given value. If the...
2 min read
Java method The java.lang. returns the value of long argument. It will throw an exception if the result overflows either int or long. Syntax public static int toIntExact (long a) Parameter a = the long value Return It returns the input argument as an int(integer) . If the argument is Long.MAX_VALUE or...
1 min read
Java method The java.lang. method returns the absolute (Positive) value of a int value. This method gives the absolute value of the argument. The argument can be int, double, long and float. Syntax: public static int abs(int i) public static double abs(double d) public static float abs(float f) public static...
2 min read
Java method The java.lang. returns the argument incremented by one. It will throw an exception if the result overflows either int or long. Syntax public static int incrementExact (int a) public static long incrementExact (long a) Parameter a = the value to increment Return It returns the argument incremented by one....
2 min read
Java method The java.lang. is used to calculate the trigonometric Arc Cosine of an angle. Arc cosine is also called as inverse of a cosine. This method returns the values between 0.0 and pi. Syntax public static double acos(double a) Parameter a = the value whose arc cosine is...
2 min read
Java method The java.lang. is used to return the hyperbolic cosine of a value. The hyperbolic cosine of any value x can be defined as (ex + e -x)/2, where e is an Euler's number. Syntax public static double cosh(double x) Parameter x = the number whose hyperbolic cosine...
2 min read
Java method The java.lang. is used to return the trigonometric sine of an angle. This method returns value between -1 to 1. Syntax public static double sin(double a) Parameter a = an angle, in radians Return It returns the sine value of the argument. If the argument is positive or negative number,...
2 min read
Java method The java.lang. is used to return the Euler's number e raised to the power of a double value and subtract one form it. Here, e is an Euler's number and it is approximately equal to 2.718281828459045. Syntax public static double expm1(double x) Parameter x = It is...
2 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India