Integer的MIN_VALUE是:-2147483648
MAX_VALUE是:2147483647
Integer的源码:
/**
* A constant holding the minimum value an {@code int} can
* have, -2<sup>31</sup>.
*/
@Native public static final int MIN_VALUE = 0x80000000;
/**
* A constant holding the maximum value an {@code int} can
* have, 2<sup>31</sup>-1.
*/
@Native public static final int MAX_VALUE = 0x7fffffff;
java中int(Integer)是4字节32位有符号数.MIN_VALUE是int能表示的最小的负数,MAX_VALUE则是int能表示的最大的正数.
但是double(Double)却不是这样.Double的源码:
/**
* A constant holding the largest positive finite value of type
* {@code double},
* (2-2<sup>-52</sup>)·2<sup>1023</sup>. It is equal to
* the hexadecimal floating-point literal
* {@code 0x1.fffffffffffffP+1023} and also equ