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
		
			
				
	
	
		
			59 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
| /* DEC	*DivideDecimalByDouble(pDst,pSrc1,l)
 | |
|  *
 | |
|  * ARGUMENT
 | |
|  *	pDst is	a pointer to the destination DEC structure.
 | |
|  *	pSrc1 is a ptr to the source1 DEC structure.
 | |
|  *	l is the double	to be divided into pSrc1
 | |
|  *
 | |
|  * DESCRIPTION
 | |
|  *	Divides	pSrc1 by 'l' and puts the result in dest DEC structure.
 | |
|  *
 | |
|  * SIDE	EFFECTS
 | |
|  *	On overflow, the dest value is destroyed.
 | |
|  *
 | |
|  * RETURNS
 | |
|  *	Returns	a pointer to the dest structure	unless overflow,
 | |
|  *   when it returns a GM_NULL.	On error, the error
 | |
|  *   is	in wGMError, unless an error was already there.
 | |
|  *
 | |
|  * POSSIBLE ERROR CODES
 | |
|  *
 | |
|  *	GM_NULLPOINTER
 | |
|  *	GM_OVERFLOW
 | |
|  *	GM_UNDERFLOW
 | |
|  *	GM_DIV0
 | |
|  *	GM_CNVRE
 | |
|  *
 | |
|  * AUTHOR
 | |
|  *  Andy Anderson   08-JUL-1987	 1500
 | |
|  *   Copyright (C) 1987-1990 Greenleaf Software	Inc.  All rights reserved.
 | |
|  *
 | |
|  * MODIFICATIONS
 | |
|  *
 | |
|  */
 | |
| 
 | |
| #include <stdio.h>
 | |
| #include "gm.h"
 | |
| #include "gmsystem.h"
 | |
| 
 | |
| DEC	*DivideDecimalByDouble(pDst,pSrc1,l)
 | |
| DEC	*pDst,*pSrc1;
 | |
| double	l;
 | |
| {
 | |
| 	DEC	decS2, *pSrc2=&decS2, *pd;
 | |
| 
 | |
| 	_MacStart(GM_DIVDFD);
 | |
| 
 | |
| 	/*  Convert the	double to a DEC	*/
 | |
| 	pSrc2=ConvDoubleToDecimal(pSrc2,l);
 | |
| 	if (!pSrc2)  {
 | |
| 		if (pDst)
 | |
| 			_MacDZero(pDst);
 | |
| 		_MacRet(GM_NULL);
 | |
| 	}
 | |
| 
 | |
| 	pd = DivideDecimal(pDst,pSrc1,pSrc2);
 | |
| 
 | |
| 	_MacRet(pd);
 | |
| }
 |