/**************************************************************************/
/*                                                                        */
/*                                 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: i_exp.c,v 1.2 1997/09/25 17:28:51 ae59 Exp $ */
/*
$Log: i_exp.c,v $
 * Revision 1.2  1997/09/25  17:28:51  ae59
 * Copyright-message
 *
 * Revision 1.1  1994/01/27  13:22:57  ae59
 * Put under RCS control
 *
 */
/****************************************************************/
/*                                                              */
/*      Filename        : i_exp.c                               */
/*                                                              */
/*      Entries         : a_intv i_exp(a)                       */
/*                        a_intv a;                             */
/*                                                              */
/*      Arguments       : a = interval argument of function     */
/*                                                              */
/*      Description     : Interval exponential function         */
/*                                                              */
/*      Date            : 1991-11-14                            */
/*      1991-11-14 : save and restore flags                     */
/*      1991-08-28 : Lexp is called in case of interval         */
/*      1991-04-22 : real assignment replaced by R_ASSIGN()     */
/*      1991-02-21 : extern L...() declaration removed          */
/*      1990-10-29 : no unary plus allowed                      */
/*      1990-10-18 : real assign  operation                     */
/****************************************************************/

#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_intv i_exp( a_intv a )
#else
local a_intv i_exp( a )
a_intv a;
#endif

{
        a_btyp        rc;
        a_intv          res;
        a_real          dummy;

        E_SPUSH("i_exp")

        /* --- point argument --- */
        if (i_point(a))
            {
            /* printf("point argument!\n"); */
            rc = i_invp(Lexp,a.INF,&res.INF,&res.SUP);
        }
        /* --- interval argument --- */
        else if (i_iv(a)) {
            /* printf("interval argument!\n"); */

            rc =  i_invp(Lexp,a.INF,&res.INF,&dummy);
            rc += i_invp(Lexp,a.SUP,&dummy,&res.SUP);
        }
        /* --- invalid argument --- */
        else rc = 1;

        /* --- error --- */
        if (rc)
            e_trap(INV_ARG,4,E_TDBL+E_TEXT(5),&a.INF,
                             E_TDBL+E_TEXT(6),&a.SUP);

        E_SPOPP("i_exp")
        return(res);
}
