Example: Treasury Bill Price
The price per $100 face value for a 1 year Treasury bill is returned in this example.
using System;
using Imsl.Finance;
public class tbillpriceEx1
{
public static void Main(String[] args)
{
DateTime settlement = DateTime.Parse("7/1/85");
DateTime maturity = DateTime.Parse("7/1/86");
double discount = .05;
double tbillprice = Bond.Tbillprice(settlement, maturity,
discount);
Console.Out.WriteLine("The price per $100 face value for the " +
"T-bill is " + tbillprice.ToString("C"));
}
}
Output
The price per $100 face value for the T-bill is $94.93
Link to C# source.