1 module test_default_format
3 module procedure test_r4
4 module procedure test_r8
7 integer, parameter :: count = 200
10 function test_r4 (start, towards) result (res)
11 integer, parameter :: k = 4
12 integer, intent(in) :: towards
13 real(k), intent(in) :: start
17 character(len=100) :: s
21 if (towards >= 0) then
26 if (y /= x) res = res + 1
27 x = nearest(x,huge(x))
31 if (towards <= 0) then
36 if (y /= x) res = res + 1
37 x = nearest(x,-huge(x))
42 function test_r8 (start, towards) result (res)
43 integer, parameter :: k = 8
44 integer, intent(in) :: towards
45 real(k), intent(in) :: start
49 character(len=100) :: s
53 if (towards >= 0) then
58 if (y /= x) res = res + 1
59 x = nearest(x,huge(x))
63 if (towards <= 0) then
68 if (y /= x) res = res + 1
69 x = nearest(x,-huge(x))
74 end module test_default_format