/* DEC *CompoundInterestCompound(nper, intr, pv, pmt, fv, begend, opt) * * ARGUMENT * int begend, opt; * DEC *nper, *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. * This function allows for a partial first period during which compound * interest is computed. * * SIDE EFFECTS * Changes value of unknown variable. * * RETURNS * In case of success, the result is returned. * * POSSIBLE ERRORS * GM_NULLPOINTER * GM_ARGVAL * * * AUTHOR * Jared Levy * Copyright (C) 1988-1990 Greenleaf Software Inc. All rights reserved. * * MODIFICATIONS * * */ #include #include "gm.h" #include "gmsystem.h" DEC *CompoundInterestCompound(nper, intr, pv, pmt, fv, begend, opt) int begend, opt; DEC *nper, *intr, *pv, *pmt, *fv; { DEC *p; _MacStart(GM_COMPCOMP); p=_CompoundAux(3, &opt, nper, intr, pv, pmt, fv, begend, opt); _MacRet(p); }