File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 395
395
@test bitreverse (Int64 (456618293 )) === Int64 (- 6012608040035942400 )
396
396
@test bitreverse (Int32 (456618293 )) === Int32 (- 1399919400 )
397
397
end
398
+
399
+ @testset " min/max of datatype" begin
400
+ @test typemin (Int8) == Int8 (- 128 )
401
+ @test typemin (UInt8) == UInt8 (0 )
402
+ @test typemin (Int16) == Int16 (- 32768 )
403
+ @test typemin (UInt16) == UInt16 (0 )
404
+ @test typemin (Int32) == Int32 (- 2147483648 )
405
+ @test typemin (UInt32) == UInt32 (0 )
406
+ @test typemin (Int64) == Int64 (- 9223372036854775808 )
407
+ @test typemin (UInt64) == UInt64 (0 )
408
+ @test typemin (Int128) == Int128 (- 170141183460469231731687303715884105728 )
409
+ @test typemin (UInt128) == UInt128 (0 )
410
+
411
+ @test typemax (Int8) == Int8 (127 )
412
+ @test typemax (UInt8) == UInt8 (255 )
413
+ @test typemax (Int16) == Int16 (32767 )
414
+ @test typemax (UInt16) == UInt16 (65535 )
415
+ @test typemax (Int32) == Int32 (2147483647 )
416
+ @test typemax (UInt32) == UInt32 (4294967295 )
417
+ @test typemax (Int64) == Int64 (9223372036854775807 )
418
+ @test typemax (UInt64) == UInt64 (0xffffffffffffffff )
419
+ @test typemax (Int128) == Int128 (170141183460469231731687303715884105727 )
420
+ @test typemax (UInt128) == UInt128 (0xffffffffffffffffffffffffffffffff )
421
+ end
You can’t perform that action at this time.
0 commit comments