Evaluates the net present value of a stream of equal periodic cash flows, which are subject to a given discount rate..
#include <imsl.h>
float imsl_f_present_value (float rate, int n_periods, float payment, float future_value, int when)
The type double function is imsl_d_present_value.
float rate
(Input)
Interest rate.
int n_periods
(Input)
Total number of periods.
float payment
(Input)
Payment made in each period.
float
future_value (Input)
The value, at some time in the
future, of a current amount and a stream of payments.
int when
(Input)
Time in each period when the payment is made, either IMSL_AT_END_OF_PERIOD
or IMSL_AT_BEGINNING_OF_PERIOD.
For a more detailed discussion on when see the Usage Notes section of
this chapter.
The present value of an investment. If no result can be computed, NaN is returned.
Function imsl_f_present_value computes the present value of an investment.
It can be found by solving the following:
If rate = 0

If rate ¹ 0

In this example, imsl_f_present_value computes the present value of 20 payments of $500,000 per payment ($10 million) with an annual interest rate of 6%. The payment is made at the end of each period.
#include <stdio.h>
#include "imsl.h"
void main()
{
float rate = 0.06;
float payment = 500000.;
float future_value = 0.;
int n_periods = 20;
int when = IMSL_AT_END_OF_PERIOD;
float present_value;
present_value = imsl_f_present_value (rate, n_periods, payment,
future_value, when);
printf ("The present value of the $10 million prize is ");
printf ("$%.2f.\n", present_value);
}
The present value of the $10 million prize is $-5734961.00.
|
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |