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
		
			
				
	
	
		
			50 lines
		
	
	
		
			846 B
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			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);
 | |
| }
 |