| 35 | static integer c__0 = 0; |
| 36 | |
| 37 | integer ieeeck_(integer *ispec, real *zero, real *one) |
| 38 | { |
| 39 | /* System generated locals */ |
| 40 | integer ret_val; |
| 41 | |
| 42 | /* Local variables */ |
| 43 | static real nan1, nan2, nan3, nan4, nan5, nan6, neginf, posinf, negzro, |
| 44 | newzro; |
| 45 | |
| 46 | |
| 47 | /* |
| 48 | -- LAPACK auxiliary routine (version 3.2.2) -- |
| 49 | -- LAPACK is a software package provided by Univ. of Tennessee, -- |
| 50 | -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- |
| 51 | June 2010 |
| 52 | |
| 53 | |
| 54 | Purpose |
| 55 | ======= |
| 56 | |
| 57 | IEEECK is called from the ILAENV to verify that Infinity and |
| 58 | possibly NaN arithmetic is safe (i.e. will not trap). |
| 59 | |
| 60 | Arguments |
| 61 | ========= |
| 62 | |
| 63 | ISPEC (input) INTEGER |
| 64 | Specifies whether to test just for inifinity arithmetic |
| 65 | or whether to test for infinity and NaN arithmetic. |
| 66 | = 0: Verify infinity arithmetic only. |
| 67 | = 1: Verify infinity and NaN arithmetic. |
| 68 | |
| 69 | ZERO (input) REAL |
| 70 | Must contain the value 0.0 |
| 71 | This is passed to prevent the compiler from optimizing |
| 72 | away this code. |
| 73 | |
| 74 | ONE (input) REAL |
| 75 | Must contain the value 1.0 |
| 76 | This is passed to prevent the compiler from optimizing |
| 77 | away this code. |
| 78 | |
| 79 | RETURN VALUE: INTEGER |
| 80 | = 0: Arithmetic failed to produce the correct answers |
| 81 | = 1: Arithmetic produced the correct answers |
| 82 | */ |
| 83 | |
| 84 | ret_val = 1; |
| 85 | |
| 86 | posinf = *one / *zero; |
| 87 | if (posinf <= *one) { |
| 88 | ret_val = 0; |
| 89 | return ret_val; |
| 90 | } |
| 91 | |
| 92 | neginf = -(*one) / *zero; |
| 93 | if (neginf >= *zero) { |
| 94 | ret_val = 0; |