44 parameter( zero = 0.0d0 )
47 integer i, nfailingtests, ntests
48 double precision ainf, anan, ov, r, x(n), y(n)
51 intrinsic huge, min, max
62 x = (/ -ainf, zero, -ainf, zero, ainf, ainf, zero, anan /)
63 y = (/ zero, ainf, ainf, -ainf, zero, -ainf, anan, zero /)
71 if( r .ne. x(i) )
then
72 nfailingtests = nfailingtests + 1
73 WRITE( *, fmt = 9998 )
'i',i,
'MIN', x(i), y(i), r
76 if( r .ne. y(i) )
then
77 nfailingtests = nfailingtests + 1
78 WRITE( *, fmt = 9998 )
'i',i,
'MAX', x(i), y(i), r
84 if( r .ne. y(i) )
then
85 nfailingtests = nfailingtests + 1
86 WRITE( *, fmt = 9998 )
'i',i,
'MIN', x(i), y(i), r
89 if( r .ne. x(i) )
then
90 nfailingtests = nfailingtests + 1
91 WRITE( *, fmt = 9998 )
'i',i,
'MAX', x(i), y(i), r
98 nfailingtests = nfailingtests + 1
99 WRITE( *, fmt = 9998 )
'i',i,
'MIN', x(i), y(i), r
101 r = max( x(i), y(i) )
103 nfailingtests = nfailingtests + 1
104 WRITE( *, fmt = 9998 )
'i',i,
'MAX', x(i), y(i), r
108 if( nfailingtests .gt. 0 )
then
109 print *,
"# ", ntests-nfailingtests,
" tests out of ", ntests,
110 $
" pass for intrinsic MIN and MAX,", nfailingtests,
" fail."
112 print *,
"# All tests pass for intrinsic MIN and MAX."
116 9998
FORMAT(
'[',a1,i1,
'] ', a3,
'(', f5.0,
',', f5.0,
') = ', f5.0 )
program zmul
zmul tests the robustness and precision of the double complex multiplication