61 lines
1.1 KiB
C
61 lines
1.1 KiB
C
|
/* DEC *DivideDecimalByLong(pDst,pSrc1,lSrc2);
|
||
|
*
|
||
|
* ARGUMENT
|
||
|
* DEC *pDst;
|
||
|
* DEC *pSrc1;
|
||
|
* long lSrc2;
|
||
|
*
|
||
|
* DESCRIPTION
|
||
|
* Divides pSrc1 by ConvLongToDecimal(lSrc2) and puts the result in
|
||
|
* pDst.
|
||
|
*
|
||
|
* SIDE EFFECTS
|
||
|
* None
|
||
|
*
|
||
|
* RETURNS
|
||
|
* Returns pointer to pDst if successful, otherwise a GM_NULL. The
|
||
|
* type error (GM_OVERFLOW, GM_NOMEMORY, GM_DIV0) is in wGMError
|
||
|
* if wGMError didn't contain a previous error on entry.
|
||
|
*
|
||
|
* POSSIBLE ERROR CODES
|
||
|
*
|
||
|
* GM_NULLPOINTER
|
||
|
* GM_UNDERFLOW
|
||
|
* GM_DIV0
|
||
|
*
|
||
|
* AUTHOR
|
||
|
* Andy Anderson 5-Mar-87 17:45
|
||
|
* Copyright (C) 1987-1990 Greenleaf Software Inc. All rights reserved.
|
||
|
*
|
||
|
* MODIFICATIONS
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include "gm.h"
|
||
|
#include "gmsystem.h"
|
||
|
|
||
|
DEC* DivideDecimalByLong(pDst,pSrc1,lSrc2)
|
||
|
DEC *pDst,*pSrc1;
|
||
|
long lSrc2;
|
||
|
{
|
||
|
|
||
|
DEC temp1,*tp1,*pd;
|
||
|
|
||
|
_MacStart(GM_DIVLD);
|
||
|
_MacInVar(pSrc1,GM_NULL);
|
||
|
_MacOutVar(pDst,GM_NULL);
|
||
|
|
||
|
/* init default pointer */
|
||
|
tp1=&temp1;
|
||
|
|
||
|
/* convert the long first, then call the divide routine */
|
||
|
tp1=ConvLongToDecimal(tp1,lSrc2);
|
||
|
|
||
|
pd = DivideDecimal(pDst,pSrc1,tp1);
|
||
|
|
||
|
/* the divide routine already set any errors */
|
||
|
_MacRet(pd);
|
||
|
|
||
|
}
|