campo-sirio/gfm/dmodi.c

46 lines
723 B
C
Raw Normal View History

/* DEC *DecimalModuloInt(pDst, pSrc1, pSrc2);
*
* ARGUMENT
* DEC *pDst, *pSrc1;
* int pSrc2;
*
* DESCRIPTION
* Sets pDst = pSrc1 mod pSrc2.
*
* SIDE EFFECTS
* None.
*
* RETURNS
* pDst if successful, otherwise GM_NULL.
*
* POSSIBLE ERRORS
* GM_NULLPOINTER
* GM_NOMEMORY
* GM_DIV0 (if pSrc2 == 0)
*
* ALGORITHM
* a mod b = a - int(a / b) * b
*
* AUTHOR
* Jared Levy
* Copyright (C) 1987-1990 Greenleaf Software Inc. All rights reserved.
*
* MODIFICATIONS
*
*
*/
#include <stdio.h>
#include "gm.h"
#include "gmsystem.h"
DEC *DecimalModuloInt(pDst, pSrc1, pSrc2)
DEC *pDst, *pSrc1;
int pSrc2;
{
_MacStart(GM_DMODI);
pDst = DecimalModuloLong(pDst, pSrc1, (long) pSrc2);
_MacRet(pDst);
}