21.4 Accuracy and the Value Range of Type and Overflow Control*
Data types in Java always have a certain number of bytes, and thus the value range is known. However, an operation can run beyond this range of values.
21.4.1 The Largest and Smallest Values
For each primitive data type, a separate class in Java is available with various methods and constants. The classes Byte, Short, Integer, Long, Float, and Double have the constants MIN_VALUE and MAX_VALUE for their minimum and maximum value ranges. The Float and Double classes also have the important constants NEGATIVE_INFINITY and POSITIVE_INFINITY for negative and positive infinity as well as NaN (undefined).
[»] Note
Integer.MIN_VALUE represents the smallest value the integer ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access