3 integer ieeeck_(integer *ispec, real *zero, real *one)
5 /* System generated locals */
9 real nan1, nan2, nan3, nan4, nan5, nan6, neginf, posinf, negzro, newzro;
12 /* -- LAPACK auxiliary routine (version 3.1) -- */
13 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
16 /* .. Scalar Arguments .. */
22 /* IEEECK is called from the ILAENV to verify that Infinity and */
23 /* possibly NaN arithmetic is safe (i.e. will not trap). */
28 /* ISPEC (input) INTEGER */
29 /* Specifies whether to test just for inifinity arithmetic */
30 /* or whether to test for infinity and NaN arithmetic. */
31 /* = 0: Verify infinity arithmetic only. */
32 /* = 1: Verify infinity and NaN arithmetic. */
34 /* ZERO (input) REAL */
35 /* Must contain the value 0.0 */
36 /* This is passed to prevent the compiler from optimizing */
39 /* ONE (input) REAL */
40 /* Must contain the value 1.0 */
41 /* This is passed to prevent the compiler from optimizing */
44 /* RETURN VALUE: INTEGER */
45 /* = 0: Arithmetic failed to produce the correct answers */
46 /* = 1: Arithmetic produced the correct answers */
48 /* .. Local Scalars .. */
50 /* .. Executable Statements .. */
53 posinf = *one / *zero;
59 neginf = -(*one) / *zero;
60 if (neginf >= *zero) {
65 negzro = *one / (neginf + *one);
66 if (negzro != *zero) {
71 neginf = *one / negzro;
72 if (neginf >= *zero) {
77 newzro = negzro + *zero;
78 if (newzro != *zero) {
83 posinf = *one / newzro;
90 if (neginf >= *zero) {
104 /* Return if we were only asked to check infinity arithmetic */
110 nan1 = posinf + neginf;
112 nan2 = posinf / neginf;
114 nan3 = posinf / posinf;
116 nan4 = posinf * *zero;
118 nan5 = neginf * negzro;