/**************************************************************************/
/*                                                                        */
/*                                 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_exp2.c,v 1.2 1997/09/25 17:28:59 ae59 Exp $ */
/*
$Log: i_exp2.c,v $
 * Revision 1.2  1997/09/25  17:28:59  ae59
 * Copyright-message
 *
 * Revision 1.1  1994/01/27  13:22:57  ae59
 * Put under RCS control
 *
 */
/****************************************************************/
/*                                                              */
/*      Filename        : i_exp2.c                 2**e         */
/*                                                              */
/*      Entries         : a_intv i_exp2(e)                      */
/*                        a_intv e;                             */
/*                                                              */
/*      Arguments                                               */
/*                      : e = interval argument exponent        */
/*                                                              */
/*      Description     : Interval power function               */
/*                                                              */
/*      Date            : 1991-11-14                            */
/*      1991-11-14 : save and restore flags                     */
/*      1990-10-18 : real constant                              */
/****************************************************************/

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

#ifdef LINT_ARGS
local a_intv i_exp2( a_intv e )
#else
local a_intv i_exp2( e )
a_intv e;
#endif

{
        a_btyp        rc;
        a_real            dummy;
        a_intv          res;

        E_SPUSH("i_exp2")

        if (0==i_iv(e) || 0==i_iv(e)) rc = 1; /* error no interval */

        /* --- 2 types --- */
        else if ( i_point(e) ) {
            rc =  i_inv2(Lpower,*r_two_,e.INF,&res.INF,&res.SUP);
        }
        else if ( i_iv(e) ) {
            rc =   i_inv2(Lpower,*r_two_,e.INF,&res.INF,&dummy);
            rc +=  i_inv2(Lpower,*r_two_,e.SUP,&dummy,&res.SUP);
        }
        else rc = 1;

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

        /* --- exit --- */
        E_SPOPP("i_exp2")
        return(res);
}


