home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
xbase
/
library
/
clipper
/
rettig
/
source
/
effyield.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-10-21
|
954b
|
39 lines
/*********
*
* EFFYIELD.C
*
* by Ralph Davis
* modified by Tom Rettig
*
* Placed in the public domain by Tom Rettig Associates, 10/22/1990.
*
*********/
/* EFFYIELD: Effective Yield (Effective Rate of Interest)
Computes effective annual interest for annual rate
compounded specified number of times per year
SYNTAX: EFFYIELD(rate, conversions)
where rate = nominal interest rate
conversions = number of times per year
interest is compounded
RETURNS: true yield
*/
#include "trlib.h"
TRTYPE effyield()
{
if ( PCOUNT==2 && ISNUM(1) && ISNUM(2) )
{
double rate = _parnd(1);
double conversions = _parnd(2);
_retnd(pow(1.0 + (rate / conversions),conversions) - 1.0);
}
else
_retnd( (double)ERROR );
}