/* DEC *FindMinimumDecimalArray(pDst, pSrc, size) * * ARGUMENT * DEC *pSrc[]; * DEC *pDst; * int size; * * DESCRIPTION * Given size DEC pointers stored in the array pSrc, finds the minimum * element and stores that value in pDst. * * SIDE EFFECTS * None. * * RETURNS * Returns GM_NULL on error, otherwise pDst. * * POSSIBLE ERROR CODES * * GM_NULLPOINTER * GM_ARGVAL (when size is 0) * * AUTHOR * AA 9-8-87 10:45 * Copyright (C) 1987-1990 Greenleaf Software Inc. All rights reserved. * * MODIFICATIONS * * */ #include #include "gm.h" #include "gmsystem.h" DEC *FindMinimumDecimalArray(pDst, pSrc, size) DEC *pSrc[]; DEC *pDst; int size; { int i,wRetVal,min; DEC *pm; _MacStart(GM_MINARR); if(!pSrc||!pDst) { _MacErr(GM_NULLPOINTER); _MacRet(GM_NULL); } if (size<=0) { _MacErr(GM_ARGVAL); _MacRet(GM_NULL); } for (i=0; i0) min=i; i++; } pm = pSrc[min]; _MacDCopy(pDst,pm); _MacRet(pDst); }