位置:首頁(yè) > 軟件操作教程 > 編程開發(fā) > Java > 問題詳情

Java Double類中的常量

提問人:劉旭39發(fā)布時(shí)間:2020-11-27

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);

}

}

image.png

繼續(xù)查找其他問題的答案?

相關(guān)視頻回答
回復(fù)(0)
返回頂部