We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f26bf3f commit e754d88Copy full SHA for e754d88
1 file changed
operators/DoubleEquivalence.java
@@ -34,12 +34,19 @@ public static void main(String[] args) {
34
35
System.out.println("------------------------");
36
37
- //最大值 和 (最大值 和 (最小值只差的一百万倍))比较
+ //最大值 和 (最大值 和 (最小值只差的一百万倍))比较 一个非常大的数值减去一个相对较小的数值,
38
+ //非常大的数值并不会发生显著变化。这个叫做 <b> 舍入误差 <\b>
39
test(Double.MAX_VALUE,
40
Double.MAX_VALUE - Double.MIN_VALUE * 1_000_000);
41
42
43
test(2.1, 3.5);
44
+
45
+ System.out.println("------------------------");
46
+ System.out.println(Double.MIN_VALUE); //2^-1074
47
+ System.out.println(Double.MAX_VALUE);
48
49
50
}
51
52
/* Output:
0 commit comments