/**************************************************************************/
/*                                                                        */
/*                                 Sources                                */
/*                                from  the                               */
/*                           XSC SOFTWARE PACKAGE                         */
/*                                                                        */
/*                Copyright (c) 1997 University of Karlsruhe              */
/*                     Institute for Appl. Mathematics                    */
/*                                                                        */
/* This program is free software for non-commercial use. For details, see */
/* the file LICENSE.XSC, distributed with this software package.          */
/*                                                                        */
/* This program is distributed WITHOUT ANY WARRANTY. For details, see the */
/* file LICENSE.XSC, distributed with this software package.              */
/*                                                                        */
/**************************************************************************/

/* RCS $Id: t_cher.c,v 1.2 1997/09/25 18:07:19 ae59 Exp $ */
/*
$Log: t_cher.c,v $
 * Revision 1.2  1997/09/25  18:07:19  ae59
 * Copyright-message
 *
 * Revision 1.1  1994/01/27  13:25:02  ae59
 * Put under RCS control
 *
 */
/*      Date    : 1991-09-06                                    */
/*      1991-09-06 : reduce maximum line length                 */

#ifdef AIX
#include "/u/p88c/runtime/tbyte/t_defs.h"
#else
#include "t_defs.h"
#endif

/*--------------------------------------------------------------*
 | check ExtReal Argument                                       |
 *--------------------------------------------------------------*/
#ifdef ANSI_C
#ifdef LINT_ARGS
int chk_extreal(const ExtReal *arg, const int code)
#else
int chk_extreal(arg, code)
const ExtReal *arg; /* zu ueberpruefendes Argument                    */
const int code;     /* condition codes, auf die geprueft werden soll  */
#endif /* LINT_ARGS */
#else  /* NOT ANSI_C */
#ifdef LINT_ARGS
int chk_extreal(ExtReal *arg, int code)
#else
int chk_extreal(arg, code)
ExtReal  *arg;       /* zu ueberpruefendes Argument                    */
int code;            /* condition codes, auf die geprueft werden soll  */
#endif /* LINT_ARGS */
#endif /* ANSI_C */
{
   int condition_code;
   int err_typ = 0;

   if(0==(code & (condition_code = _s_xam(arg))))
        err_typ=cond_to_exc(condition_code);
   else
      /* --- pruefe auf unsupported 8087 Unnormals --- */
      if(-1==cmpabsee(arg, &MinNormExtReal))
         /* Unormals sind < Denormals */
      if(_s_chk_invalid(arg)) err_typ = ExcInvalid;

   return err_typ;
} /* chk_extreal() */
