Java Math.ulp() methodLast Updated : 17 Mar 2025 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 |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India