/**************************************************************************/
/*                                                                        */
/*                                 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: l_umin.c,v 1.2 1997/09/25 17:40:28 ae59 Exp $ */
/*
$Log: l_umin.c,v $
 * Revision 1.2  1997/09/25  17:40:28  ae59
 * Copyright-message
 *
 * Revision 1.1  1994/01/27  13:23:34  ae59
 * Put under RCS control
 *
 */
/****************************************************************/
/*                                                              */
/*      Filename        : l_umin.c                              */
/*                                                              */
/*      Entries         : multiprecision l_umin(i1)             */
/*                        multiprecision i1;                    */
/*                                                              */
/*      Description     : Negative of multi-precision number.   */
/*                                                              */
/*      Date            : 1990-11-22                            */
/*      1990-11-22 : E_TPUSH+E_TPOPP                            */
/*      1990-10-30 : test for temporary flag                    */
/*      1990-07-19 : LINT_ARGS prototype                        */
/****************************************************************/

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

#ifdef LINT_ARGS
local multiprecision l_umin(multiprecision i1)
#else
local multiprecision l_umin(i1)

multiprecision i1;
#endif
        {
        multiprecision res;

        E_TPUSH("l_umin")

        if (i1->f && i1->l<=b_maxl)
           {
           res = i1;
           res->s = 1-res->s;
           }
        else
           {
           l_init(&res);
           if (res==NULL || b_bcpy(i1,res))
              e_trap(ALLOCATION,2,E_TMSG,65);
           else
              {
              res->s = 1-res->s;
              res->f = 1;
              }
           }

        E_TPOPP("l_umin")
        return(res);
        }
