campo-sirio/gfm/deltrz.c
alex ba237a9d91 Patch level : no patch
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
2002-02-26 12:19:02 +00:00

56 lines
885 B
C
Executable File

/* DEC *DeleteTrailingZeroes(pDst, pSrc)
*
* ARGUMENT
* DEC *pSrc;
* DEC *pDst;
*
* DESCRIPTION
* Changes the interal representation of pSrc without changing its value
* by removing any trailing zeroes, if possible, and storing the result in
* pDst.
*
* SIDE EFFECTS
* None.
*
* RETURNS
* None.
*
* AUTHOR
* Jared Levy
* Copyright (C) 1987-1990 Greenleaf Software Inc. All rights reserved.
*
* MODIFICATIONS
*
*/
#include <stdio.h>
#include "gm.h"
#include "gmsystem.h"
DEC *DeleteTrailingZeroes(pDst, pSrc)
DEC *pSrc;
DEC *pDst;
{
DEC dTemp, *pTemp=&dTemp;
unsigned i=0;
_MacStart(GM_DELTRZ);
_MacInVarD(pSrc);
_MacOutVarD(pDst);
_MacDCopy(pTemp, pSrc);
while ((i==0) && (pTemp->dc.id>0)) {
_MacDCopy(pDst, pTemp);
i = _DivUnsArrByUns(pTemp->dc.sl, 10, 5);
pTemp->dc.id--;
}
if (i==0)
_MacDCopy(pDst,pTemp);
_MacRet(pDst);
}