Class YearFractionToDateFunctions
The "inverse" of a day counter: the date a year fraction reaches.
public static class YearFractionToDateFunctions
- Inheritance
-
YearFractionToDateFunctions
- Inherited Members
Methods
RoundToDayStart(Date)
The date rounded to the start of its day: the date itself.
public static Date RoundToDayStart(Date d)
Parameters
dDateThe date.
Returns
- Date
The date.
Remarks
A date has no time of day here, as in QuantLib's default build, whose roundToDayStart returns the date
unchanged; its high-resolution build rounds a date at or past noon to the next day.
YearFractionToDate(DayCounter, Date, double)
The date whose year fraction from the reference date, by the day counter, is closest to a time.
public static Date YearFractionToDate(DayCounter dayCounter, Date referenceDate, double t)
Parameters
dayCounterDayCounterThe day counter.
referenceDateDateThe reference date.
tdoubleThe year fraction.
Returns
- Date
The date.
Remarks
QuantLib casts a NaN time's day count to an integer unchecked, which is undefined
(yearfractiontodate.cpp:40-41): here a NaN is refused on entry, a documented divergence. An infinite or
overflowing day count is refused where QuantLib's boost::numeric_cast throws.
Exceptions
- ArgumentNullException
dayCounteris null.- ArgumentException
tis NaN, or its day count overflows an integer (an infinite time among them); orreferenceDateisdefault(Date).