位置:首页 > 软件操作教程 > 编程开发 > Java > 问题详情

Java Double类中的常量

提问人:刘旭39发布时间: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类型的二进制补码位数:"+doubleSize);

System.out.println("double类型的二进制补码字节数:"+doubleBytes);

}

}

image.png

继续查找其他问题的答案?

相关视频回答
回复(0)
返回顶部