Alternatives:
Use cngb_py_ai if there is no odd last period and calculation performance is an issue
Notes:
This routine internally determines the number of remaining periods to maturity/redemption and selects the appropriate formula (less than or equal to one period or greater than one period) to use for price/yield calculations.
Results:
All results are calculated using the industry standard or generally accepted practices, and are accurate to as many places as supported by a double precision value. The variable calculated contains the calculated dollar price to redemption per 100 of maturity value or yield to redemption as a percent. The variable ai contains the accrued interest per 100 of maturity value.
Error Conditions:
Returned values should be ignored for a non-zero status. See Errors.