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);
}
}
已有 22658 名学员学习以下课程通过考试
最需教育客户端 软件问题一手掌握
去 App Store 免费下载 iOS 客户端
点击加载更多评论>>