@@ -12,18 +12,16 @@ setprecision(BigFloat, 256) do
12
12
13
13
@test sprint (show, MIME (" text/plain" ), emptyinterval (BareInterval{Float64})) == " ∅"
14
14
15
- @test sprint (show, MIME (" text/plain" ), a) == " [-2.22508e-308, 1.30001]"
16
- @test sprint (show, MIME (" text/plain" ), large_expo) ==
17
- " [0.0, 1.00001e+123456789]₂₅₆"
15
+ @test sprint (show, MIME (" text/plain" ), a) == " [-2.22508e-308, 1.3]"
16
+ @test sprint (show, MIME (" text/plain" ), large_expo) == " [0.0, 1.0e+123456789]₂₅₆"
18
17
end
19
18
20
19
@testset " 20 significant digits" begin
21
20
# `decorations` keyword has no impact for `BareInterval`
22
21
setdisplay (; sigdigits = 20 , decorations = true )
23
22
24
- @test sprint (show, MIME (" text/plain" ), a) == " [-2.2250738585072014e-308, 1.3000000000000000445]"
25
- @test sprint (show, MIME (" text/plain" ), large_expo) ==
26
- " [0.0, 1.0000000000000000001e+123456789]₂₅₆"
23
+ @test sprint (show, MIME (" text/plain" ), a) == " [-2.2250738585072014e-308, 1.3]"
24
+ @test sprint (show, MIME (" text/plain" ), large_expo) == " [0.0, 1.0e+123456789]₂₅₆"
27
25
end
28
26
end
29
27
@@ -45,9 +43,8 @@ setprecision(BigFloat, 256) do
45
43
46
44
@test sprint (show, MIME (" text/plain" ), emptyinterval (BareInterval{Float64})) == " ∅"
47
45
48
- @test sprint (show, MIME (" text/plain" ), a) == " 0.65 ± 0.650001"
49
- @test sprint (show, MIME (" text/plain" ), large_expo) ==
50
- " (5.0e+123456788 ± 5.00001e+123456788)₂₅₆"
46
+ @test sprint (show, MIME (" text/plain" ), a) == " 0.65 ± 0.65"
47
+ @test sprint (show, MIME (" text/plain" ), large_expo) == " (5.0e+123456788 ± 5.00001e+123456788)₂₅₆"
51
48
end
52
49
end
53
50
@@ -75,13 +72,12 @@ setprecision(BigFloat, 256) do
75
72
76
73
@test sprint (show, MIME (" text/plain" ), a) == " [1.0, 2.0]_com"
77
74
@test sprint (show, MIME (" text/plain" ), a_NG) == " [1.0, 2.0]_com_NG"
78
- @test sprint (show, MIME (" text/plain" ), b) == " [-2.22508e-308, 1.30001 ]_com"
79
- @test sprint (show, MIME (" text/plain" ), b32) == " [-1.1755f-38, 1.30001f0 ]_com"
80
- @test sprint (show, MIME (" text/plain" ), b16) == " [Float16(-6.104e-5), Float16(1.29981 )]_com"
75
+ @test sprint (show, MIME (" text/plain" ), b) == " [-2.22508e-308, 1.3 ]_com"
76
+ @test sprint (show, MIME (" text/plain" ), b32) == " [-1.1755f-38, 1.3f0 ]_com"
77
+ @test_broken sprint (show, MIME (" text/plain" ), b16) == " [Float16(-6.104e-5), Float16(1.3 )]_com"
81
78
@test sprint (show, MIME (" text/plain" ), br) == " [-11//10, 13//10]_com"
82
79
@test sprint (show, MIME (" text/plain" ), c) == " [-1.0, ∞)_dac"
83
- @test sprint (show, MIME (" text/plain" ), large_expo) ==
84
- " [0.0, 1.00001e+123456789]₂₅₆_com"
80
+ @test sprint (show, MIME (" text/plain" ), large_expo) == " [0.0, 1.0e+123456789]₂₅₆_com"
85
81
end
86
82
87
83
@testset " No decorations" begin
@@ -92,13 +88,12 @@ setprecision(BigFloat, 256) do
92
88
93
89
@test sprint (show, MIME (" text/plain" ), a) == " [1.0, 2.0]"
94
90
@test sprint (show, MIME (" text/plain" ), a_NG) == " [1.0, 2.0]_NG"
95
- @test sprint (show, MIME (" text/plain" ), b) == " [-2.22508e-308, 1.30001 ]"
96
- @test sprint (show, MIME (" text/plain" ), b32) == " [-1.1755f-38, 1.30001f0 ]"
97
- @test sprint (show, MIME (" text/plain" ), b16) == " [Float16(-6.104e-5), Float16(1.29981 )]"
91
+ @test sprint (show, MIME (" text/plain" ), b) == " [-2.22508e-308, 1.3 ]"
92
+ @test sprint (show, MIME (" text/plain" ), b32) == " [-1.1755f-38, 1.3f0 ]"
93
+ @test_broken sprint (show, MIME (" text/plain" ), b16) == " [Float16(-6.104e-5), Float16(1.3 )]"
98
94
@test sprint (show, MIME (" text/plain" ), br) == " [-11//10, 13//10]"
99
95
@test sprint (show, MIME (" text/plain" ), c) == " [-1.0, ∞)"
100
- @test sprint (show, MIME (" text/plain" ), large_expo) ==
101
- " [0.0, 1.00001e+123456789]₂₅₆"
96
+ @test sprint (show, MIME (" text/plain" ), large_expo) == " [0.0, 1.0e+123456789]₂₅₆"
102
97
end
103
98
end
104
99
@@ -107,13 +102,12 @@ setprecision(BigFloat, 256) do
107
102
108
103
@test sprint (show, MIME (" text/plain" ), a) == " [1.0, 2.0]_com"
109
104
@test sprint (show, MIME (" text/plain" ), a_NG) == " [1.0, 2.0]_com_NG"
110
- @test sprint (show, MIME (" text/plain" ), b) == " [-2.2250738585072014e-308, 1.3000000000000000445 ]_com"
111
- @test sprint (show, MIME (" text/plain" ), b32) == " [-1.1754944f-38, 1.2999999523162841797f0 ]_com"
112
- @test sprint (show, MIME (" text/plain" ), b16) == " [Float16(-6.104e-5), Float16(1.2998046875000000001 )]_com"
105
+ @test sprint (show, MIME (" text/plain" ), b) == " [-2.2250738585072014e-308, 1.3 ]_com"
106
+ @test sprint (show, MIME (" text/plain" ), b32) == " [-1.1754944f-38, 1.3f0 ]_com"
107
+ @test_broken sprint (show, MIME (" text/plain" ), b16) == " [Float16(-6.104e-5), Float16(1.3 )]_com"
113
108
@test sprint (show, MIME (" text/plain" ), br) == " [-11//10, 13//10]_com"
114
109
@test sprint (show, MIME (" text/plain" ), c) == " [-1.0, ∞)_dac"
115
- @test sprint (show, MIME (" text/plain" ), large_expo) ==
116
- " [0.0, 1.0000000000000000001e+123456789]₂₅₆_com"
110
+ @test sprint (show, MIME (" text/plain" ), large_expo) == " [0.0, 1.0e+123456789]₂₅₆_com"
117
111
end
118
112
end
119
113
@@ -146,13 +140,12 @@ setprecision(BigFloat, 256) do
146
140
147
141
@test sprint (show, MIME (" text/plain" ), a) == " (1.5 ± 0.5)_com"
148
142
@test sprint (show, MIME (" text/plain" ), a_NG) == " (1.5 ± 0.5)_com_NG"
149
- @test sprint (show, MIME (" text/plain" ), b) == " (0.65 ± 0.650001 )_com"
150
- @test sprint (show, MIME (" text/plain" ), b32) == " (0.65f0 ± 0.650001f0 )_com"
151
- @test sprint (show, MIME (" text/plain" ), b16) == " (Float16(0.649902) ± Float16(0.649903 ))_com"
143
+ @test sprint (show, MIME (" text/plain" ), b) == " (0.65 ± 0.65 )_com"
144
+ @test_broken sprint (show, MIME (" text/plain" ), b32) == " (0.65f0 ± 0.65f0 )_com"
145
+ @test_broken sprint (show, MIME (" text/plain" ), b16) == " (Float16(0.649902) ± Float16(0.65 ))_com"
152
146
@test sprint (show, MIME (" text/plain" ), br) == " (1//10 ± 6//5)_com"
153
147
@test sprint (show, MIME (" text/plain" ), c) == " (1.79769e+308 ± ∞)_dac"
154
- @test sprint (show, MIME (" text/plain" ), large_expo) ==
155
- " (5.0e+123456788 ± 5.00001e+123456788)₂₅₆_com"
148
+ @test sprint (show, MIME (" text/plain" ), large_expo) == " (5.0e+123456788 ± 5.00001e+123456788)₂₅₆_com"
156
149
end
157
150
158
151
@testset " No decorations" begin
@@ -163,13 +156,12 @@ setprecision(BigFloat, 256) do
163
156
164
157
@test sprint (show, MIME (" text/plain" ), a) == " 1.5 ± 0.5"
165
158
@test sprint (show, MIME (" text/plain" ), a_NG) == " (1.5 ± 0.5)_NG"
166
- @test sprint (show, MIME (" text/plain" ), b) == " 0.65 ± 0.650001 "
167
- @test sprint (show, MIME (" text/plain" ), b32) == " 0.65f0 ± 0.650001f0 "
168
- @test sprint (show, MIME (" text/plain" ), b16) == " Float16(0.649902) ± Float16(0.649903 )"
159
+ @test sprint (show, MIME (" text/plain" ), b) == " 0.65 ± 0.65 "
160
+ @test_broken sprint (show, MIME (" text/plain" ), b32) == " 0.65f0 ± 0.65f0 "
161
+ @test_broken sprint (show, MIME (" text/plain" ), b16) == " Float16(0.649902) ± Float16(0.65 )"
169
162
@test sprint (show, MIME (" text/plain" ), br) == " 1//10 ± 6//5"
170
163
@test sprint (show, MIME (" text/plain" ), c) == " 1.79769e+308 ± ∞"
171
- @test sprint (show, MIME (" text/plain" ), large_expo) ==
172
- " (5.0e+123456788 ± 5.00001e+123456788)₂₅₆"
164
+ @test sprint (show, MIME (" text/plain" ), large_expo) == " (5.0e+123456788 ± 5.00001e+123456788)₂₅₆"
173
165
end
174
166
end
175
167
end
@@ -190,15 +182,15 @@ setprecision(BigFloat, 256) do
190
182
191
183
@test sprint (show, MIME (" text/plain" ), a) == " [0.0, 2.0]_com + im*[1.0, 1.0]_com"
192
184
@test sprint (show, MIME (" text/plain" ), b) == " [0.0, 2.0]_com - im*[1.0, 1.0]_com"
193
- @test sprint (show, MIME (" text/plain" ), c) == " [0.0, 1.00001e -70]_com - im*[0.999999e -70, 1.00001e -70]_com"
185
+ @test sprint (show, MIME (" text/plain" ), c) == " [0.0, 1.0e -70]_com - im*[1.0e -70, 1.0e -70]_com"
194
186
end
195
187
196
188
@testset " No decorations" begin
197
189
setdisplay (; decorations = false )
198
190
199
191
@test sprint (show, MIME (" text/plain" ), a) == " [0.0, 2.0] + im*[1.0, 1.0]"
200
192
@test sprint (show, MIME (" text/plain" ), b) == " [0.0, 2.0] - im*[1.0, 1.0]"
201
- @test sprint (show, MIME (" text/plain" ), c) == " [0.0, 1.00001e -70] - im*[0.999999e -70, 1.00001e -70]"
193
+ @test sprint (show, MIME (" text/plain" ), c) == " [0.0, 1.0e -70] - im*[1.0e -70, 1.0e -70]"
202
194
end
203
195
end
204
196
end
@@ -209,7 +201,7 @@ setprecision(BigFloat, 256) do
209
201
210
202
@test sprint (show, MIME (" text/plain" ), a) == " Interval{Float64}(0.0, 2.0, com) + im*Interval{Float64}(1.0, 1.0, com)"
211
203
@test sprint (show, MIME (" text/plain" ), b) == " Interval{Float64}(0.0, 2.0, com) - im*Interval{Float64}(1.0, 1.0, com)"
212
- # @test sprint(show, MIME("text/plain"), c) == "Interval{Float64}(0.0, 2.0 , com) + im*Interval{Float64}(1.0 , 1.0 , com)"
204
+ @test sprint (show, MIME (" text/plain" ), c) == " Interval{Float64}(0.0, 1.0e-70 , com) - im*Interval{Float64}(1.0e-70 , 1.0e-70 , com)"
213
205
end
214
206
215
207
@testset " Midpoint format" begin
@@ -220,15 +212,15 @@ setprecision(BigFloat, 256) do
220
212
221
213
@test sprint (show, MIME (" text/plain" ), a) == " (1.0 ± 1.0)_com + im*(1.0 ± 0.0)_com"
222
214
@test sprint (show, MIME (" text/plain" ), b) == " (1.0 ± 1.0)_com - im*(1.0 ± 0.0)_com"
223
- @test sprint (show, MIME (" text/plain" ), c) == " (5.0e-71 ± 5.00001e -71)_com - im*(1.0e-70 ± 0.0)_com"
215
+ @test sprint (show, MIME (" text/plain" ), c) == " (5.0e-71 ± 5.0e -71)_com - im*(1.0e-70 ± 0.0)_com"
224
216
end
225
217
226
218
@testset " No decorations" begin
227
219
setdisplay (; decorations = false )
228
220
229
221
@test sprint (show, MIME (" text/plain" ), a) == " (1.0 ± 1.0) + im*(1.0 ± 0.0)"
230
222
@test sprint (show, MIME (" text/plain" ), b) == " (1.0 ± 1.0) - im*(1.0 ± 0.0)"
231
- @test sprint (show, MIME (" text/plain" ), c) == " (5.0e-71 ± 5.00001e -71) - im*(1.0e-70 ± 0.0)"
223
+ @test sprint (show, MIME (" text/plain" ), c) == " (5.0e-71 ± 5.0e -71) - im*(1.0e-70 ± 0.0)"
232
224
end
233
225
end
234
226
end
0 commit comments