1 INTEGER FUNCTION IEEECK( ISPEC, ZERO, ONE )
3 ! -- LAPACK auxiliary routine (version 3.1) --
4 ! Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
7 ! .. Scalar Arguments ..
15 ! IEEECK is called from the ILAENV to verify that Infinity and
16 ! possibly NaN arithmetic is safe (i.e. will not trap).
21 ! ISPEC (input) INTEGER
22 ! Specifies whether to test just for inifinity arithmetic
23 ! or whether to test for infinity and NaN arithmetic.
24 ! = 0: Verify infinity arithmetic only.
25 ! = 1: Verify infinity and NaN arithmetic.
28 ! Must contain the value 0.0
29 ! This is passed to prevent the compiler from optimizing
33 ! Must contain the value 1.0
34 ! This is passed to prevent the compiler from optimizing
37 ! RETURN VALUE: INTEGER
38 ! = 0: Arithmetic failed to produce the correct answers
39 ! = 1: Arithmetic produced the correct answers
42 REAL NAN1, NAN2, NAN3, NAN4, NAN5, NAN6, NEGINF, &
43 NEGZRO, NEWZRO, POSINF
45 ! .. Executable Statements ..
49 IF( POSINF.LE.ONE ) THEN
55 IF( NEGINF.GE.ZERO ) THEN
60 NEGZRO = ONE / ( NEGINF+ONE )
61 IF( NEGZRO.NE.ZERO ) THEN
67 IF( NEGINF.GE.ZERO ) THEN
72 NEWZRO = NEGZRO + ZERO
73 IF( NEWZRO.NE.ZERO ) THEN
79 IF( POSINF.LE.ONE ) THEN
84 NEGINF = NEGINF*POSINF
85 IF( NEGINF.GE.ZERO ) THEN
90 POSINF = POSINF*POSINF
91 IF( POSINF.LE.ONE ) THEN
99 ! Return if we were only asked to check infinity arithmetic
104 NAN1 = POSINF + NEGINF
106 NAN2 = POSINF / NEGINF
108 NAN3 = POSINF / POSINF
116 IF( NAN1.EQ.NAN1 ) THEN
121 IF( NAN2.EQ.NAN2 ) THEN
126 IF( NAN3.EQ.NAN3 ) THEN
131 IF( NAN4.EQ.NAN4 ) THEN
136 IF( NAN5.EQ.NAN5 ) THEN
141 IF( NAN6.EQ.NAN6 ) THEN