Java: Range of a float
float is a 32-bit IEEE 754 floating point.
Min value (inclusive) and max value (inclusive):
The maximum value is available as a constant:
The minimum value is
-Float.MAX_VALUE, and not
IEEE 754 values are symmetrical around origo as opposed to two’s complement integers.
Float.MIN_VALUE is the smallest value greater than 0, i.e. not the smallest possible value. (This constant corresponds to
Epsilon in .NET.)
See ranges of all primitive types here: Java: Ranges of Primitive Types.