function bv = bondvalue(c,T,r,par) ;
%	Computes bv = bond values (current prices) 
%
%		INPUT
%	c = coupon payment (semi-annual)
%	T = time to maturity (in years)
%	r = yields to maturity (semi-annual rates)
%	par = par value

%   c, T, r, and par can be scalars or vectors the same length.

bv = c./r + (par - c./r) .* (1+r).^(-2*T) ;
