/**************************************************************************/
/*                                                                        */
/*                                 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_sico.c,v 1.2 1997/09/25 18:22:05 ae59 Exp $ */
/*
$Log: t_sico.c,v $
 * Revision 1.2  1997/09/25  18:22:05  ae59
 * Copyright-message
 *
 * Revision 1.1  1994/01/27  13:25:46  ae59
 * Put under RCS control
 *
 */
#ifdef AIX
#include "/u/p88c/runtime/tbyte/t_defs.h"
#else
#include "t_defs.h"
#endif

/*--------------------------------------------------------------*/
/* sincos                                                       */
/*--------------------------------------------------------------*/
#ifdef ANSI_C
#ifdef LINT_ARGS
int sincos(const ExtReal *arg, ExtReal *res)
#else
int sincos(arg, res)
const ExtReal  *arg;    /* reduziertes Argument                 */
      ExtReal  *res;    /* Ergebnis                             */
#endif /* LINT_ARGS */
#else  /* NOT ANSI_C */
#ifdef LINT_ARGS
int sincos(ExtReal *arg, ExtReal *res)
#else
int sincos(arg, res)
ExtReal  *arg;          /* reduziertes Argument                 */
ExtReal  *res;          /* Ergebnis                             */
#endif /* LINT_ARGS */
#endif /* ANSI_C */
{
   ExtReal     t;       /* -pi/2 <= Argument t <= pi/2          */
   int         rnd;     /* RundungsMode                         */
   int         ret;     /* Rueckgabe                            */

   /* --- RundungsMode sichern, NEAR setzen --- */
   rnd  = getrndmode();
   setrndmode(NEAR);

   /* --- arg*Pi/2 --- */
   mulee(arg, &PiHalf, &t);

   /* --- Sinus --- */
   ret = _s_sin(&t, res);

   /* --- RundungsMode zuruecksetzen --- */
   setrndmode(rnd);

   return ret;
} /* sincos() */
