Type | Field | Summary |
---|---|---|
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
Type | Field | Summary |
---|---|---|
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
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |