ba237a9d91
Files correlati : Ricompilazione Demo : [ ] Commento : Aggiunti i sorgenti per Greenleaf Math Library (gfm.dll) git-svn-id: svn://10.65.10.50/trunk@10079 c028cbd2-c16b-5b4b-a496-9718f37d4682
55 lines
855 B
C
Executable File
55 lines
855 B
C
Executable File
/* DEC *DecimalModuloDouble(pDst, pSrc1, pSrc2);
|
|
*
|
|
* ARGUMENT
|
|
* DEC *pDst, *pSrc1;
|
|
* double pSrc2;
|
|
*
|
|
* DESCRIPTION
|
|
* Sets pDst = pSrc1 mod pSrc2.
|
|
*
|
|
* SIDE EFFECTS
|
|
* None.
|
|
*
|
|
* RETURNS
|
|
* pDst if successful, otherwise GM_NULL.
|
|
*
|
|
* POSSIBLE ERRORS
|
|
* GM_NULLPOINTER
|
|
* GM_DIV0 (if pSrc2 == 0)
|
|
* GM_CNVRE
|
|
*
|
|
* 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 *DecimalModuloDouble(pDst, pSrc1, pSrc2)
|
|
DEC *pDst, *pSrc1;
|
|
double pSrc2;
|
|
{
|
|
DEC dt2, *t2=&dt2, *pd;
|
|
|
|
_MacStart(GM_DMODDF);
|
|
|
|
t2 = ConvDoubleToDecimal(t2, pSrc2);
|
|
if (!t2) {
|
|
if (pDst)
|
|
_MacDCopy(pDst, pSrc1);
|
|
_MacRet(GM_NULL);
|
|
}
|
|
|
|
pd = ModuloDecimal(pDst, pSrc1, t2);
|
|
_MacRet(pd);
|
|
}
|