Table of Contents

Class YearFractionToDateFunctions

Namespace
NanoQL.Time
Assembly
NanoQL.dll

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

d Date

The 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

dayCounter DayCounter

The day counter.

referenceDate Date

The reference date.

t double

The 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

dayCounter is null.

ArgumentException

t is NaN, or its day count overflows an integer (an infinite time among them); or referenceDate is default(Date).