/* DEC *SquareRootDecimal(pDst,pSrc1) * * ARGUMENT * DEC *pDst; * DEC *pSrc1; * * DESCRIPTION * Sets pDst = square root of pSrc1. * * SIDE EFFECTS * * RETURNS * Returns pointer to pDst if successful, otherwise a GM_NULL. * * POSSIBLE ERROR CODES * * GM_NULLPOINTER * GM_IMAG * * AUTHOR * Jared Levy Aug 7, 1987 * Copyright (C) 1987-1990 Greenleaf Software Inc. All rights reserved. * * MODIFICATIONS * */ #include #include "gm.h" #include "gmsystem.h" DEC *SquareRootDecimal(pDst,pSrc1) DEC *pDst; DEC *pSrc1; { _MacStart(GM_DSQRT); _MacInVarD(pSrc1); _MacOutVarD(pDst); if (_MacIsDecN(pSrc1)) { _MacErr(GM_IMAG); _MacRet(GM_NULL); } /* no errors possible if pSrc1 >= 0 */ _SqrtDec80Bit(pDst, pSrc1); /* reduce from 80-bit back to 64-bit */ (void) _Sq5UnsTo4Uns(pDst); _MacRet(pDst); }