@@ -255,48 +255,48 @@ end
255
255
256
256
@testset " 128-bit conversion correctness" begin
257
257
@testset " Convert from 64-bit to 128-bit" begin
258
- @test Base . convert (WFD2, 1 ). i === Int128 (100 )
259
- @test Base . convert (UWFD2, 1 ). i === UInt128 (100 )
260
- @test Base . convert (WFD2, - 1 ). i === Int128 (- 100 )
261
- @test_throws InexactError (:convert , UWFD2, - 1 ) Base . convert (UWFD2, - 1 )
262
- @test Base . convert (WFD2, UInt (1 )). i === Int128 (100 )
263
- @test Base . convert (UWFD2, UInt (1 )). i === UInt128 (100 )
264
- @test Base . convert (WFD2, typemax (Int)). i === Int128 (922337203685477580700 )
265
- @test Base . convert (UWFD2, typemax (Int)). i === UInt128 (922337203685477580700 )
266
- @test Base . convert (WFD2, typemin (Int)). i === Int128 (- 922337203685477580800 )
267
- @test_throws InexactError (:convert , UWFD2, typemin (Int)) Base . convert (UWFD2, typemin (Int))
268
- @test Base . convert (WFD2, typemax (UInt)). i === Int128 (1844674407370955161500 )
269
- @test Base . convert (UWFD2, typemax (UInt)). i === UInt128 (1844674407370955161500 )
258
+ @test convert (WFD2, 1 ). i === Int128 (100 )
259
+ @test convert (UWFD2, 1 ). i === UInt128 (100 )
260
+ @test convert (WFD2, - 1 ). i === Int128 (- 100 )
261
+ @test_throws InexactError (:convert , UWFD2, - 1 ) convert (UWFD2, - 1 )
262
+ @test convert (WFD2, UInt (1 )). i === Int128 (100 )
263
+ @test convert (UWFD2, UInt (1 )). i === UInt128 (100 )
264
+ @test convert (WFD2, typemax (Int)). i === Int128 (922337203685477580700 )
265
+ @test convert (UWFD2, typemax (Int)). i === UInt128 (922337203685477580700 )
266
+ @test convert (WFD2, typemin (Int)). i === Int128 (- 922337203685477580800 )
267
+ @test_throws InexactError (:convert , UWFD2, typemin (Int)) convert (UWFD2, typemin (Int))
268
+ @test convert (WFD2, typemax (UInt)). i === Int128 (1844674407370955161500 )
269
+ @test convert (UWFD2, typemax (UInt)). i === UInt128 (1844674407370955161500 )
270
270
end
271
271
272
272
@testset " Convert from 128-bit to 128-bit" begin
273
- @test Base . convert (WFD2, Int128 (1 )). i === Int128 (100 )
274
- @test Base . convert (UWFD2, Int128 (1 )). i === UInt128 (100 )
275
- @test Base . convert (WFD2, UInt128 (1 )). i === Int128 (100 )
276
- @test Base . convert (UWFD2, UInt128 (1 )). i === UInt128 (100 )
277
- @test Base . convert (WFD2, Int128 (- 1 )). i === Int128 (- 100 )
278
- @test_throws InexactError (:convert , UWFD2, Int128 (- 1 )) Base . convert (UWFD2, Int128 (- 1 ))
279
- @test_throws InexactError (:convert , WFD2, typemax (Int128)) Base . convert (WFD2, typemax (Int128))
280
- @test_throws InexactError (:convert , UWFD2, typemax (Int128)) Base . convert (UWFD2, typemax (Int128))
281
- @test_throws InexactError (:convert , WFD2, typemin (Int128)) Base . convert (WFD2, typemin (Int128))
282
- @test_throws InexactError (:convert , UWFD2, typemin (Int128)) Base . convert (UWFD2, typemin (Int128))
283
- @test_throws InexactError (:convert , WFD2, typemax (UInt128)) Base . convert (WFD2, typemax (UInt128))
284
- @test_throws InexactError (:convert , UWFD2, typemax (UInt128)) Base . convert (UWFD2, typemax (UInt128))
273
+ @test convert (WFD2, Int128 (1 )). i === Int128 (100 )
274
+ @test convert (UWFD2, Int128 (1 )). i === UInt128 (100 )
275
+ @test convert (WFD2, UInt128 (1 )). i === Int128 (100 )
276
+ @test convert (UWFD2, UInt128 (1 )). i === UInt128 (100 )
277
+ @test convert (WFD2, Int128 (- 1 )). i === Int128 (- 100 )
278
+ @test_throws InexactError (:convert , UWFD2, Int128 (- 1 )) convert (UWFD2, Int128 (- 1 ))
279
+ @test_throws InexactError (:convert , WFD2, typemax (Int128)) convert (WFD2, typemax (Int128))
280
+ @test_throws InexactError (:convert , UWFD2, typemax (Int128)) convert (UWFD2, typemax (Int128))
281
+ @test_throws InexactError (:convert , WFD2, typemin (Int128)) convert (WFD2, typemin (Int128))
282
+ @test_throws InexactError (:convert , UWFD2, typemin (Int128)) convert (UWFD2, typemin (Int128))
283
+ @test_throws InexactError (:convert , WFD2, typemax (UInt128)) convert (WFD2, typemax (UInt128))
284
+ @test_throws InexactError (:convert , UWFD2, typemax (UInt128)) convert (UWFD2, typemax (UInt128))
285
285
end
286
286
287
287
@testset " Convert from 128-bit to 64-bit" begin
288
- @test Base . convert (FD2, Int128 (1 )). i === Int (100 )
289
- @test Base . convert (UFD2, Int128 (1 )). i === UInt (100 )
290
- @test Base . convert (FD2, UInt128 (1 )). i === Int (100 )
291
- @test Base . convert (UFD2, UInt128 (1 )). i === UInt (100 )
292
- @test Base . convert (FD2, Int128 (- 1 )). i === Int (- 100 )
293
- @test_throws InexactError (:convert , UFD2, Int128 (- 1 )) Base . convert (UFD2, Int128 (- 1 ))
294
- @test_throws InexactError (:convert , FD2, typemax (Int128)) Base . convert (FD2, typemax (Int128))
295
- @test_throws InexactError (:convert , UFD2, typemax (Int128)) Base . convert (UFD2, typemax (Int128))
296
- @test_throws InexactError (:convert , FD2, typemin (Int128)) Base . convert (FD2, typemin (Int128))
297
- @test_throws InexactError (:convert , UFD2, typemin (Int128)) Base . convert (UFD2, typemin (Int128))
298
- @test_throws InexactError (:convert , FD2, typemax (UInt128)) Base . convert (FD2, typemax (UInt128))
299
- @test_throws InexactError (:convert , UFD2, typemax (UInt128)) Base . convert (UFD2, typemax (UInt128))
288
+ @test convert (FD2, Int128 (1 )). i === Int (100 )
289
+ @test convert (UFD2, Int128 (1 )). i === UInt (100 )
290
+ @test convert (FD2, UInt128 (1 )). i === Int (100 )
291
+ @test convert (UFD2, UInt128 (1 )). i === UInt (100 )
292
+ @test convert (FD2, Int128 (- 1 )). i === Int (- 100 )
293
+ @test_throws InexactError (:convert , UFD2, Int128 (- 1 )) convert (UFD2, Int128 (- 1 ))
294
+ @test_throws InexactError (:convert , FD2, typemax (Int128)) convert (FD2, typemax (Int128))
295
+ @test_throws InexactError (:convert , UFD2, typemax (Int128)) convert (UFD2, typemax (Int128))
296
+ @test_throws InexactError (:convert , FD2, typemin (Int128)) convert (FD2, typemin (Int128))
297
+ @test_throws InexactError (:convert , UFD2, typemin (Int128)) convert (UFD2, typemin (Int128))
298
+ @test_throws InexactError (:convert , FD2, typemax (UInt128)) convert (FD2, typemax (UInt128))
299
+ @test_throws InexactError (:convert , UFD2, typemax (UInt128)) convert (UFD2, typemax (UInt128))
300
300
end
301
301
end
302
302
0 commit comments