@@ -33,20 +33,24 @@ g = Float16(1.)
33
33
@test_throws InexactError convert (UInt128, Float16 (3.5 ))
34
34
@test_throws InexactError convert (UInt128, Float16 (- 1 ))
35
35
36
- x = Float32 (rand ())
37
- y = Float32 (rand ())
38
- z = Float32 (rand ())
39
- @test_approx_eq Float16 (x)^ 2 Float16 (x^ 2 )
40
- @test round (Int,Float16 (x)) == round (Int,x)
41
- @test trunc (Int,Float16 (x)) == trunc (Int,x)
42
- @test floor (Int,Float16 (x)) == floor (Int,x)
43
- @test ceil (Int,Float16 (x)) == ceil (Int,x)
44
- @test round (Float16 (x)) == round (x)
45
- @test trunc (Float16 (x)) == trunc (x)
46
- @test floor (Float16 (x)) == floor (x)
47
- @test ceil (Float16 (x)) == ceil (x)
48
- @test_approx_eq fma (Float16 (x),Float16 (y),Float16 (z)) fma (x,y,z)
49
- @test_approx_eq muladd (Float16 (x),Float16 (y),Float16 (z)) muladd (x,y,z)
36
+ @test_approx_eq Float16 (0.5f0 )^ 2 Float16 (0.5f0 ^ 2 )
37
+ @test round (Int,Float16 (0.5f0 )) == round (Int,0.5f0 )
38
+ @test trunc (Int,Float16 (0.9f0 )) === trunc (Int,0.9f0 ) === 0
39
+ @test floor (Int,Float16 (0.9f0 )) === floor (Int,0.9f0 ) === 0
40
+ @test trunc (Int,Float16 (1 )) === 1
41
+ @test floor (Int,Float16 (1 )) === 1
42
+ @test ceil (Int,Float16 (0.1f0 )) === ceil (Int,0.1f0 ) === 1
43
+ @test ceil (Int,Float16 (0 )) === ceil (Int,0 ) === 0
44
+ @test round (Float16 (0.1f0 )) == round (0.1f0 ) == 0
45
+ @test round (Float16 (0.9f0 )) == round (0.9f0 ) == 1
46
+ @test trunc (Float16 (0.9f0 )) == trunc (0.9f0 ) == 0
47
+ @test floor (Float16 (0.9f0 )) == floor (0.9f0 ) == 0
48
+ @test trunc (Float16 (1 )) === Float16 (1 )
49
+ @test floor (Float16 (1 )) === Float16 (1 )
50
+ @test ceil (Float16 (0.1 )) == ceil (0.1 )
51
+ @test ceil (Float16 (0.9 )) == ceil (0.9 )
52
+ @test_approx_eq fma (Float16 (0.1 ),Float16 (0.9 ),Float16 (0.5 )) fma (0.1 ,0.9 ,0.5 )
53
+ @test_approx_eq muladd (Float16 (0.1 ),Float16 (0.9 ),Float16 (0.5 )) muladd (0.1 ,0.9 ,0.5 )
50
54
@test convert (Int128,Float16 (- 1.0 )) == Int128 (- 1 )
51
55
@test convert (UInt128,Float16 (5.0 )) == UInt128 (5 )
52
56
0 commit comments