MAX/MIN_VALUE Find out the Maximum value and Minimum value a float type can have

static float MAX_VALUE
Largest positive finite value of type float.
static float MIN_VALUE
Smallest positive nonzero value of type float.
static int MAX_EXPONENT
Maximum exponent a finite float variable may have.
static int MIN_EXPONENT
Minimum exponent a normalized float variable may have.
static float MIN_NORMAL
Smallest positive normal value of type float.

public class Main {
  public static void main(String[] args) {
    System.out.println("MAX_VALUE:"+Float.MAX_VALUE);
    System.out.println("MIN_VALUE:"+Float.MIN_VALUE);
    System.out.println("MAX_EXPONENT:"+Float.MAX_EXPONENT);
    System.out.println("MIN_EXPONENT:"+Float.MIN_EXPONENT);
    System.out.println("MIN_NORMAL:"+Float.MIN_NORMAL);
  }
}

The output:


MAX_VALUE:3.4028235E38
MIN_VALUE:1.4E-45
MAX_EXPONENT:127
MIN_EXPONENT:-126
MIN_NORMAL:1.17549435E-38
static float NaN
Not-a-Number (NaN) value of type float.
static float NEGATIVE_INFINITY
Negative infinity of type float.
static float POSITIVE_INFINITY
Positive infinity of type float.
static int SIZE
The number of bits used to represent a float value.
static Class TYPE
The Class instance representing the primitive type float.

public class Main {
  public static void main(String[] args) {
    System.out.println("NaN:"+Float.NaN);
    System.out.println("NEGATIVE_INFINITY:"+Float.NEGATIVE_INFINITY);
    System.out.println("POSITIVE_INFINITY:"+Float.POSITIVE_INFINITY);
    System.out.println("SIZE:"+Float.SIZE);
  }
}

The output:


NaN:NaN
NEGATIVE_INFINITY:-Infinity
POSITIVE_INFINITY:Infinity
SIZE:32
Home 
  Java Book 
    Essential Classes  

Float:
  1. Float class
  2. MAX/MIN_VALUE Find out the Maximum value and Minimum value a float type can have
  3. Create a Float object
  4. Convert Float to byte, double, float, int, long and short
  5. Compare two float objects
  6. Infinite and Not A Number
  7. Convert float value to Hex String value
  8. Convert float value to String value
  9. Convert string value to float value
  10. Bit oriented calculation for float