3 ! I/O test for REAL(16)
5 ! Contributed by Dominique d'Humieres
8 use iso_fortran_env
, only
: real_kinds
10 integer, parameter :: QP
= real_kinds(ubound(real_kinds
,dim
=1))
11 real(kind
=qp
) :: a
,b(2), c
12 integer :: exponent
, i
13 character(len
=180) :: tmp
15 ! Run this only with libquadmath; assume that all those systems
17 if (size (real_kinds
) >= 4 .and
. qp
== 16) then
19 if (real_kinds(i
) /= 10) stop
22 b(:) = huge (1.0_qp
)/10.0_qp
**exponent
23 ! print *, 'real(16) big value: ', b(1)
26 ! print *, 'same value read again: ', a, c
27 ! print *, 'difference: looks OK now ', a-b(1)
28 if (abs (a
-b(1))/a
> epsilon(0.0_qp
) &
29 .or
. abs (c
-b(1))/c
> epsilon (0.0_qp
)) STOP 1