/**************************************************************************/
/*                                                                        */
/*                                 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: a_abs_.c,v 1.2 1997/09/25 16:48:42 ae59 Exp $ */
/*
$Log: a_abs_.c,v $
 * Revision 1.2  1997/09/25  16:48:42  ae59
 * Copyright-message
 *
 * Revision 1.1  1994/01/27  13:20:37  ae59
 * Put under RCS control
 *
 */
/****************************************************************/
/*                                                              */
/*      Filename        : a_abs_.c                              */
/*                                                              */
/*      Entries         : a_intg a_abs_(a)                      */
/*                        a_intg a;                             */
/*                                                              */
/*      Arguments       : a = integer argument of standard      */
/*                            function abs                      */
/*                                                              */
/*      Description     : Absolute value of integer             */
/*                                                              */
/*      Note            : 0 returned in case of error           */
/*                                                              */
/*      Date            : 1990-11-15                            */
/*      1990-11-15 : E_TPUSH+E_TPOPP                            */
/*      1990-07-16 : NO_ERROR replaced by OVERFLOW              */
/****************************************************************/

#ifndef ALL_IN_ONE
#ifdef AIX
#include "/u/p88c/runtime/o_defs.h"
#else
#include "o_defs.h"
#endif
#define local
#endif

#ifdef LINT_ARGS
local a_intg a_abs_(a_intg a)
#else
local a_intg a_abs_(a)

a_intg a;
#endif
        {

        E_TPUSH("a_abs_")

        if (a<0)
           {
           if (a==MININT)
              {
              e_trap(OVERFLOW,4,E_TMSG,15,E_TINT+E_TEXT(7),&a);
              a = 0;
              }
           else
              a = -a;
           }

        E_TPOPP("a_abs_")
        return(a);
        }

