Java Math.ulp() method21 Mar 2025 | 2 min read The java.lang.Math.ulp() returns the size of an ulp of the argument. An ulp is the unit in the last place. An ulp of a float or double value is the positive distance between given value and the next value that is larger in magnitude. Note: For non-NaN x, ulp(-x) == ulp(x).SyntaxParameterReturn
Example 1Output: 1.7763568394002505E-15 Example 2Output: 7.105427357601002E-15 Example 3Output: Infinity Example 4Output: 4.9E-324 Example 5Output: 1.9958403095347198E292 Example 6Output: 2.028241E31 Next TopicJava Math |
Java method The java.lang. returns the argument decremented by one. It will throw an exception if the result overflows either int or long. Syntax public static int DecrementExact (int a) public static long decrementExact (long a) Parameter a = the value to decrement Return It returns the argument decremented by one....
2 min read
Java method The java.lang. is used to find the largest integer value that is less than or equal to the algebraic quotient. This method first divide the first argument by the second argument and then performs a floor() operation over the result and returns the...
2 min read
Java () method The java.lang.() is a built-in math function in java which is used to convert an angle measured in radians to an approximately equivalent angle measured in degrees. Syntax public static double toDegrees(double x) Parameter x = an angle, in radians Return It returns the measurement of the angle x...
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. returns the sum of its arguments. It will throw an exception if the result overflows either int or long. Syntax public static int addExact(int a, int b) public static long addExact(long a, long b) Parameter a = the first value b = the second value Return It returns...
2 min read
Java Math.Down() method The java.lang.Math.Down() is a built-in math method in java. It returns the floating-point value adjacent to the user specified parameter (d) in the direction of negative infinity. This method is equivalent to After(d, Double.NEGATIVE_INFINITY) method. Implementation of Down may run faster than its equivalent...
2 min read
Java method The java.lang. 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. Syntax public static int round(float x) public static long round(double x) Parameter x= It is a floating-point...
2 min read
Java method The java.lang. returns the negation of the argument. It will throw an exception if the result overflows either int or long. Syntax public static int negateExact (int a) public static long negateExact (long a) Parameter a = the value to negate Return It returns the negation of the argument. If...
2 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.Math.copySign () is used to return the first argument with the sign of the second argument. Syntax public static double copySign(double a, double b) public static float copySign(float a, float b) Parameter a = the argument providing the magnitude of the result b = the argument providing the...
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