LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ 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 infinity 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.

Definition at line 81 of file ieeeck.f.

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