LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ ieeeck()

integer function ieeeck ( integer  ISPEC,
real  ZERO,
real  ONE 
)

IEEECK

Download IEEECK + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 IEEECK is called from the ILAENV to verify that Infinity and
 possibly NaN arithmetic is safe (i.e. will not trap).
Parameters
[in]ISPEC
          ISPEC is INTEGER
          Specifies whether to test just for inifinity arithmetic
          or whether to test for infinity and NaN arithmetic.
          = 0: Verify infinity arithmetic only.
          = 1: Verify infinity and NaN arithmetic.
[in]ZERO
          ZERO is REAL
          Must contain the value 0.0
          This is passed to prevent the compiler from optimizing
          away this code.
[in]ONE
          ONE is REAL
          Must contain the value 1.0
          This is passed to prevent the compiler from optimizing
          away this code.

  RETURN VALUE:  INTEGER
          = 0:  Arithmetic failed to produce the correct answers
          = 1:  Arithmetic produced the correct answers
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 84 of file ieeeck.f.

84 *
85 * -- LAPACK auxiliary routine (version 3.7.0) --
86 * -- LAPACK is a software package provided by Univ. of Tennessee, --
87 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
88 * December 2016
89 *
90 * .. Scalar Arguments ..
91  INTEGER ispec
92  REAL one, zero
93 * ..
94 *
95 * =====================================================================
96 *
97 * .. Local Scalars ..
98  REAL nan1, nan2, nan3, nan4, nan5, nan6, neginf,
99  $ negzro, newzro, posinf
100 * ..
101 * .. Executable Statements ..
102  ieeeck = 1
103 *
104  posinf = one / zero
105  IF( posinf.LE.one ) THEN
106  ieeeck = 0
107  RETURN
108  END IF
109 *
110  neginf = -one / zero
111  IF( neginf.GE.zero ) THEN
112  ieeeck = 0
113  RETURN
114  END IF
115 *
116  negzro = one / ( neginf+one )
117  IF( negzro.NE.zero ) THEN
118  ieeeck = 0
119  RETURN
120  END IF
121 *
122  neginf = one / negzro
123  IF( neginf.GE.zero ) THEN
124  ieeeck = 0
125  RETURN
126  END IF
127 *
128  newzro = negzro + zero
129  IF( newzro.NE.zero ) THEN
130  ieeeck = 0
131  RETURN
132  END IF
133 *
134  posinf = one / newzro
135  IF( posinf.LE.one ) THEN
136  ieeeck = 0
137  RETURN
138  END IF
139 *
140  neginf = neginf*posinf
141  IF( neginf.GE.zero ) THEN
142  ieeeck = 0
143  RETURN
144  END IF
145 *
146  posinf = posinf*posinf
147  IF( posinf.LE.one ) THEN
148  ieeeck = 0
149  RETURN
150  END IF
151 *
152 *
153 *
154 *
155 * Return if we were only asked to check infinity arithmetic
156 *
157  IF( ispec.EQ.0 )
158  $ RETURN
159 *
160  nan1 = posinf + neginf
161 *
162  nan2 = posinf / neginf
163 *
164  nan3 = posinf / posinf
165 *
166  nan4 = posinf*zero
167 *
168  nan5 = neginf*negzro
169 *
170  nan6 = nan5*zero
171 *
172  IF( nan1.EQ.nan1 ) THEN
173  ieeeck = 0
174  RETURN
175  END IF
176 *
177  IF( nan2.EQ.nan2 ) THEN
178  ieeeck = 0
179  RETURN
180  END IF
181 *
182  IF( nan3.EQ.nan3 ) THEN
183  ieeeck = 0
184  RETURN
185  END IF
186 *
187  IF( nan4.EQ.nan4 ) THEN
188  ieeeck = 0
189  RETURN
190  END IF
191 *
192  IF( nan5.EQ.nan5 ) THEN
193  ieeeck = 0
194  RETURN
195  END IF
196 *
197  IF( nan6.EQ.nan6 ) THEN
198  ieeeck = 0
199  RETURN
200  END IF
201 *
202  RETURN
integer function ieeeck(ISPEC, ZERO, ONE)
Definition: tstiee.f:626
Here is the call graph for this function: