Re: a bug in Bonds.cpp
Posted by
Dagur Gunnarsson-2 on
Feb 14, 2012; 11:10am
URL: http://quantlib.414.s1.nabble.com/a-bug-in-Bonds-cpp-tp8727p8729.html
Hello,
I suspect that this bug is also in
00232 Rate Bond::yield(Real cleanPrice,
const DayCounter& dc,
Compounding comp,
Frequency freq,
Date settlement,
Real accuracy,
Size maxEvaluations) const {
Real currentNotional = notional(settlementDate());
if (currentNotional == 0.0)
return 0.0;
return BondFunctions::yield(*this, cleanPrice, dc, comp, freq,
settlement, accuracy, maxEvaluations);
}
regards
Dagur G
On Mon, Feb 13, 2012 at 5:22 PM, Luigi Ballabio
<[hidden email]> wrote:
Yes, it's a bug. I've fixed it on the 1.2 branch now.
Thanks for the heads-up.
Luigi
On Mon, Feb 13, 2012 at 3:15 PM, Dagur Gunnarsson <
[hidden email]> wrote:
> 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
>
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
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-d2d_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users