Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/isEndOfMonth-tp12800p12802.html
On Tue, 2009-09-01 at 17:58 +0200, Ferdinando Ametrano wrote:
> On Tue, Sep 1, 2009 at 3:45 PM, Dima<
[hidden email]> wrote:
> > Wouldn't it make sense to add [to isEndOfMonth]:
> > if(!isBusinessDay(d)) return false
>
> no, it doesn't, at least not in general.
Hmm. Pity I didn't get this mail before committing...
> E.g. bond maturity date being on a non-business end-of-month day, you
> might want all other dates to be end-of-month
But then, _in the schedule constructor_, you would check the maturity
with Date::isEndOfMonth, or adjust the maturity with Preceding and check
that for end-of-month. The meaning of Calendar::isEndOfMonth shouldn't
depend on the use we want to do of the date, and according to the docs
is "is this the last business day of the month?".
If we decide that the meaning of ifEndOfMonth is "are there any business
days after this?" (which is a different thing) then the implementation
is ok. But in that case we have to change the documentation.
Thoughts?
Luigi
--
There is no likelihood man can ever tap the power of the atom.
-- Robert Millikan, Nobel Prize in Physics, 1923
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.
http://p.sf.net/sfu/bobj-july_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev