                     Treasury Price Yield Function Library
                                 by RBWooster
                                CIS:72415,1602

   The file TYIELD.PLB contains ten C language functions callable by 
FoxPro 2.0.  These do yield-to-price or price-to-yield calculations 
for USTreasury bills, notes and bonds, and strips.  The results 
conform to industry standards.

   The following files are included herewith:

       TYIELD.PLB, the function library,
       TYIELD.PRG, a program that exercises the functions in the PLB,
       TYIELD.C, the source code for the functions
       MKTSYLIB.BAT, a sample batch file to create TYIELD.PLB, and
       README.TXT, this file.

   INCLUDED FUNCTIONS:

       BD2P( dV, dM, nDR) - returns dollar price of a Tsy bill
       BD2Y( dV, dM, nDR) - bond equivalent of a Tsy bill
       NP2Y( dV, dM, dI, nCR, nDP) - yield to maturity of a Tsy note
       NY2P( dV, dM, dI, nCR, nY) - dollar price of a Tsy note
       ZP2Y( dV, dM, nDP) - yield to maturity of a Tsy strip/zero
       ZY2P( dV, dM, nY) - dollar price of a Tsy strip/zero
       NTAI( dV, dM, dI, nCR) - accrued interest on a Tsy note/bond
       MDUR( dV, dM, dI, nCR, nY) - modified duration of a Tsy note/bond
       CVXY( dV, dM, dI, nCR, nY) - convexity of a Tsy note/bond
       YV32( dV, dM, dI, nCR, nP) - yield value of a price change of 1/32
       DV01( dV, dM, dI, nCR, nY) - $ value/MM of a yield change of 1 b.p.

       where:
           dV: value/settlement date
           dM: maturity date
           dI: issue/dated date or {0/0/0} if not relevant
          nDR: the discount rate in % ( 2.75)
          nCR: the coupon rate in % per year (5.25)
          nDP: the dollar price in % (100.03125)
           nY: the yield to maturity in % (4.8776)

   TO USE:

       Put the file TYIELD.PLB somewhere FoxPro can find it.
       Include the following line in your program (.PRG) before
       any of the functions are invoked:

           SET LIBRARY TO TYIELD

   MISCELLANEOUS NOTES:
       The C routines were designed with an extra level of function calls.
       The API functions simply do the necessary data conversions then call
       the associated native C functions.  This was done to facilitate
       debugging and testing in Borland C of the routines that do the
       actual calculations.

       YV32 and DV01 also work for bills.  Just pass 0 for the coupon rate.

   Enjoy.