Calculates an average rate for a range of dates for a floating rate security
Introduced in release: 1.0 Component: Generic Purpose:
This routine calculates an average rate during a period for a floating rate security. It takes an array of dates (in the form month, day, year) and an array of rates, and then, for a given start date to a given end date, computes an average rate during that period. If there are 100 or fewer entries in the arrays, the dates need not be arranged in date order - the routine will sort them internally. However, if there are more than 100 entries in the array, the routine assumes they are already in sorted order. If you need to sort a date array and its corresponding rate array, you can use the sort_MDYs routine.
Notes:
This routine calculates the average rate on an Actual/Actual calendar only.
Results:
The result is a single rate which is the average rate during the given period, accurate to as many places as supported by a double precision value. If the given start date is prior to the earliest date for which a rate has been defined, the rate from that earliest date is used.
Error Conditions:
Returned values should be ignored for a non-zero status. See Errors.