Login  Register

a bug in Bonds.cpp

Posted by Dagur Gunnarsson-2 on Feb 13, 2012; 2:15pm
URL: http://quantlib.414.s1.nabble.com/a-bug-in-Bonds-cpp-tp8727.html

hello, 

Is it ok, to post bugs in this mailgroup?  I suspect that there is a bug in the following code.

00247 
Real Bond::accruedAmount(Date settlement) const {
  Real currentNotional = notional(settlementDate());
  if (currentNotional == 0.0)
   return 0.0;

  return BondFunctions::accruedAmount(*this, settlement);
}

the code is taken from  http://quantlib.sourcearchive.com/documentation/1.1-1/bond_8cpp_source.html

notional(settlementDate()) should be notional(settlement) instead - my unit tests stopped working for a bond that had a maturity the 8th of February.

regards
Dagur G

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users