campo-sirio/src/gfm/dsign.c
mtollari 1b14ec9415 Spostamento cartella sorgenti
git-svn-id: svn://10.65.10.50/branches/R_10_00@23236 c028cbd2-c16b-5b4b-a496-9718f37d4682
2016-09-09 13:59:02 +00:00

50 lines
846 B
C
Executable File

/* int TestSignDecimal(pSrc1);
*
* ARGUMENT
* DEC *pSrc1;
*
* DESCRIPTION
* Decides whether pSrc1 is positive, negative, or zero.
*
* SIDE EFFECTS
* None.
*
* RETURNS
* Returns 1 if scr1 is positive.
* 0 if pSrc1 is zero.
* -1 if scr1 is negative.
* Returns GM_NULLPOINTER if pSrc1 points to a null.
*
* POSSIBLE ERROR CODES
*
* GM_NULLPOINTER
*
* AUTHOR
* Andy Anderson 27-JAN-1987 19:00
* Copyright (C) 1987-1990 Greenleaf Software Inc. All rights reserved.
*
* MODIFICATIONS
*
*/
#include <stdio.h>
#include "gm.h"
#include "gmsystem.h"
int TestSignDecimal(pSrc1)
DEC *pSrc1;
{
_MacStart(GM_DSIGN);
_MacInVarI(pSrc1);
/* keep checks in this order */
if(_MacIsDecP(pSrc1)) /* means positive AND non-zero */
_MacRet(1);
if(_MacIsDecN(pSrc1)) /* negative bit set */
_MacRet(-1);
_MacRet(0);
}