Java Double類中的常量
Double類中的常量
代碼如下所示
//Double類中的常量
public class DoubleConstant{
public static void main(String[] args) {
double maxDouble = Double.MAX_VALUE;
double minDouble = Double.MIN_VALUE;
int maxExponent = Double.MAX_EXPONENT;
int minExponent = Double.MIN_EXPONENT;
double negativeInfinity = Double.NEGATIVE_INFINITY;
double positiveInfinity = Double.POSITIVE_INFINITY;
double naN = Double.NaN;
int doubleSize = Double.SIZE;
int doubleBytes =Double.BYTES;
System.out.println("double類型最大正有限值為:"+maxDouble);
System.out.println("double類型最小正非零值為:"+minDouble);
System.out.println("double類型的二進(jìn)制補(bǔ)碼位數(shù):"+doubleSize);
System.out.println("double類型的二進(jìn)制補(bǔ)碼字節(jié)數(shù):"+doubleBytes);
}
}
點(diǎn)擊加載更多評(píng)論>>