Skip to content

Commit

Permalink
changed min/max of mjd to return an int
Browse files Browse the repository at this point in the history
  • Loading branch information
xanthos committed Nov 26, 2023
1 parent c0daaa6 commit e14d238
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/dtfund.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,14 +899,24 @@ class modified_julian_day {
*/
constexpr underlying_type &__member_ref__() noexcept { return m_mjd; }

/** Max possible modified_julian_day */
/** @brief Max possible modified_julian_day
*
* Note that we are return the maximum allowed integer here (not
* long/unsigned, etc..). This is for easy comparisson (i.e. guarding
* against overflow when comparing with ints).
*/
constexpr static modified_julian_day max() noexcept {
return modified_julian_day{std::numeric_limits<underlying_type>::max()};
return modified_julian_day{std::numeric_limits<int>::max()};
}

/** Min possible modified_julian_day */
/** @brief Min possible modified_julian_day
*
* Note that we are return the minimum allowed integer here (not
* long/unsigned, etc..). This is for easy comparisson (i.e. guarding
* against overflow when comparing with ints).
*/
constexpr static modified_julian_day min() noexcept {
return modified_julian_day{std::numeric_limits<underlying_type>::min()};
return modified_julian_day{std::numeric_limits<int>::min()};
}

/** Constructor; default Modified Julian Day is 1.
Expand Down

0 comments on commit e14d238

Please sign in to comment.