campo-sirio/gfm/dsin.c

50 lines
782 B
C
Raw Normal View History

/* DEC *SineDecimal(pDst,pSrc)
*
* ARGUMENT
* DEC *pDst;
* DEC *pSrc;
*
* DESCRIPTION
* Sets pDst = the sine of pSrc radians.
*
* SIDE EFFECTS
*
* RETURNS
* Returns pointer to pDst if successful, otherwise a GM_NULL.
*
* POSSIBLE ERROR CODES
*
* GM_NULLPOINTER
*
* AUTHOR
* Jared Levy Oct 16, 1987
* Copyright (C) 1987-1990 Greenleaf Software Inc. All rights reserved.
*
* MODIFICATIONS
*
*/
#include <stdio.h>
#include "gm.h"
#include "gmsystem.h"
DEC *SineDecimal(pDst,pSrc)
DEC *pDst;
DEC *pSrc;
{
DEC *temp, dtemp;
_MacStart(GM_DSIN);
_MacInVarD(pSrc);
_MacOutVarD(pDst);
/* sin(x) = cos(pi/2 - x) */
temp = &dtemp;
(void) _SubDec80Bit(temp, &decPiOver2, pSrc);
_CosDec80Bit(pDst, temp);
(void) _Sq5UnsTo4Uns(pDst);
_MacRet(pDst);
}