19#ifndef MTCORE_CALENDARS_EGYPTIAN_HPP
20#define MTCORE_CALENDARS_EGYPTIAN_HPP
35 static constexpr std::string_view
name =
"Egyptian";
67 if (
const auto c =
year <=> o.year; c != std::strong_ordering::equivalent) {
70 if (
const auto c =
month <=> o.month; c != std::strong_ordering::equivalent) {
73 if (
const auto c =
day <=> o.day; c != std::strong_ordering::equivalent) {
76 return std::strong_ordering::equivalent;
80 const auto days = rdDate.day -
EPOCH;
83 const auto egyptianDay = days - 365 * (egyptianYear - 1) - 30 * (egyptianMonth - 1) + 1;
84 return Egyptian{
static_cast<decltype(
year)
>(egyptianYear),
static_cast<decltype(
month)
>(egyptianMonth),
85 static_cast<decltype(
day)
>(egyptianDay)};
90 static_cast<i32>(
day - 1)))};
constexpr R floor(T num) noexcept
Floors a number with support for constexpr and fast runtime compilation.
constexpr Res mod(L left, R right) noexcept
Calculates the mathematical mod of two numbers.
int32_t i32
Alias for 32-bit ints.
uint8_t u8
Alias for 8-bit unsigned ints.
constexpr i32 EGYPTIAN_EPOCH
Base calendar system tracking the number of days since its epoch.
Represents the ancient Egyptian calendaring system.
static constexpr std::string_view name
static constexpr Egyptian from_fixed(const Fixed &rdDate) noexcept
constexpr Fixed to_fixed() const noexcept
AstronomicalYear year
Year of the date.
constexpr auto operator<=>(const Egyptian &o) const noexcept
static constexpr auto EPOCH
u8 day
Day of the month: 1-30 (epagomenae 1-5)
Month month
MONTH of the year (1-13)