MCPcopy Create free account
hub / github.com/catboost/catboost / DayOfYearToMonth

Function DayOfYearToMonth

util/datetime/systime.cpp:127–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
126
127 constexpr int DayOfYearToMonth(ui32& yearDay, const bool leapYear) {
128 if (yearDay >= 31 + 28 + leapYear) {
129 yearDay += 2 - leapYear;
130 }
131 const ui32 month = (yearDay * 67 + 35) >> 11;
132 yearDay -= (month * 489 + 8) >> 4;
133 return static_cast<int>(month);
134 }
135
136 class TDayNoToYearLookupTable {
137 static constexpr int TableSize = 128;

Callers 1

GmTimeRFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected