SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ pdlachkieee_()

void pdlachkieee_ ( Int isieee,
double *  rmax,
double *  rmin 
)

Definition at line 217 of file pdlaiect.c.

218{
219/*
220*
221* Purpose
222* =======
223*
224* pdlachkieee performs a simple check to make sure that the features
225* of the IEEE standard that we rely on are implemented. In some
226* implementations, pdlachkieee may not return.
227*
228* Note that all arguments are call-by-reference so that this routine
229* can be directly called from Fortran code.
230*
231* This is a ScaLAPACK internal subroutine and arguments are not
232* checked for unreasonable values.
233*
234* Arguments
235* =========
236*
237* ISIEEE (local output) INTEGER
238* On exit, ISIEEE = 1 implies that all the features of the
239* IEEE standard that we rely on are implemented.
240* On exit, ISIEEE = 0 implies that some the features of the
241* IEEE standard that we rely on are missing.
242*
243* RMAX (local input) DOUBLE PRECISION
244* The overflow threshold ( = DLAMCH('O') ).
245*
246* RMIN (local input) DOUBLE PRECISION
247* The underflow threshold ( = DLAMCH('U') ).
248*
249* =====================================================================
250*
251* .. Local Scalars ..
252*/
253 double x, pinf, pzero, ninf, nzero;
254 Int ieflag, *ix, sbit1, sbit2, negone=-1, errornum;
255/* ..
256* .. Executable Statements ..
257*/
258
259 pdlasnbt_( &ieflag );
260
261 pinf = *rmax / *rmin;
262 pzero = 1.0 / pinf;
263 pinf = 1.0 / pzero;
264
265 if( pzero != 0.0 ){
266 printf("pzero = %g should be zero\n",pzero);
267 *isieee = 0;
268 return ;
269 }
270 if( ieflag == 1 ){
271 sbit1 = (*((Int *)&pzero) >> 31) & 1;
272 sbit2 = (*((Int *)&pinf) >> 31) & 1;
273 }else if(ieflag == 2){
274 sbit1 = (*(((Int *)&pzero)+1) >> 31) & 1;
275 sbit2 = (*(((Int *)&pinf)+1) >> 31) & 1;
276 }
277 if( sbit1 == 1 ){
278 printf("Sign of positive infinity is incorrect\n");
279 *isieee = 0;
280 }
281 if( sbit2 == 1 ){
282 printf("Sign of positive zero is incorrect\n");
283 *isieee = 0;
284 }
285
286 ninf = -pinf;
287 nzero = 1.0 / ninf;
288 ninf = 1.0 / nzero;
289
290 if( nzero != 0.0 ){
291 printf("nzero = %g should be zero\n",nzero);
292 *isieee = 0;
293 }
294 if( ieflag == 1 ){
295 sbit1 = (*((Int *)&nzero) >> 31) & 1;
296 sbit2 = (*((Int *)&ninf) >> 31) & 1;
297 }else if(ieflag == 2){
298 sbit1 = (*(((Int *)&nzero)+1) >> 31) & 1;
299 sbit2 = (*(((Int *)&ninf)+1) >> 31) & 1;
300 }
301 if( sbit1 == 0 ){
302 printf("Sign of negative infinity is incorrect\n");
303 *isieee = 0;
304 }
305 if( sbit2 == 0 ){
306 printf("Sign of negative zero is incorrect\n");
307 *isieee = 0;
308 }
309}
#define Int
Definition Bconfig.h:22
void pdlasnbt_(Int *ieflag)
Definition pdlaiect.c:23
Here is the call graph for this function: