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
		
			
				
	
	
		
			52 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
/* DEC	*CompoundInterest(nper,	intr, pv, pmt, fv, begend, opt)
 | 
						|
 *
 | 
						|
 * ARGUMENT
 | 
						|
 *	int	*nper, begend, opt;
 | 
						|
 *	DEC	*intr, *pv, *pmt, *fv;
 | 
						|
 *
 | 
						|
 * DESCRIPTION
 | 
						|
 *	Given four variables involved in compound interest, solves for the
 | 
						|
 *  fifth one.	The variables are the number of	periods	nper, the percentage
 | 
						|
 *  interest rate per period intr, the present value pv, the periodic payment
 | 
						|
 *  pmt, and the future	value fv.  begend specifies whether payments take
 | 
						|
 *  place at the beginning or the end of each month, while opt tells which
 | 
						|
 *  variable to	solve for.
 | 
						|
 *
 | 
						|
 * SIDE	EFFECTS
 | 
						|
 *	Changes	value of unknown variable.
 | 
						|
 *
 | 
						|
 * RETURNS
 | 
						|
 *	In case	of success when	not solving for	nper, the result is returned.
 | 
						|
 *  If solving for nper	or if an error occurs, GM_NULL is returned.
 | 
						|
 *
 | 
						|
 * POSSIBLE ERRORS
 | 
						|
 *	GM_NULLPOINTER
 | 
						|
 *	GM_ARGVAL
 | 
						|
 *
 | 
						|
 *
 | 
						|
 * AUTHOR
 | 
						|
 *  Jared Levy
 | 
						|
 *   Copyright (C) 1988-1990 Greenleaf Software	Inc.  All rights reserved.
 | 
						|
 *
 | 
						|
 * MODIFICATIONS
 | 
						|
 *
 | 
						|
 *
 | 
						|
 */
 | 
						|
 | 
						|
#include <stdio.h>
 | 
						|
#include "gm.h"
 | 
						|
#include "gmsystem.h"
 | 
						|
 | 
						|
DEC	*CompoundInterest(nper,	intr, pv, pmt, fv, begend, opt)
 | 
						|
int	*nper, begend, opt;
 | 
						|
DEC	*intr, *pv, *pmt, *fv;
 | 
						|
{
 | 
						|
	DEC	*p;
 | 
						|
 | 
						|
	_MacStart(GM_COMP);
 | 
						|
 | 
						|
	p=_CompoundAux(1, nper,	intr, intr, pv,	pmt, fv, begend, opt);
 | 
						|
 | 
						|
	_MacRet(p);
 | 
						|
}
 |