Skip to content

Commit

Permalink
adding tpdate and mjd
Browse files Browse the repository at this point in the history
  • Loading branch information
xanthospap committed Jul 19, 2024
1 parent eb7de7e commit 444fd10
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/tpdate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,16 @@ class TwoPartDate {
return TwoPartDate(_mjd - d._mjd, _fsec - d._fsec);
}

/** Remove integral days */
TwoPartDate operator-(const modified_julian_day days) const noexcept {
return TwoPartDate(_mjd - days.as_underlying_type(), _fsec);
}

/** Add integral days */
TwoPartDate operator+(const modified_julian_day days) const noexcept {
return TwoPartDate(_mjd + days.as_underlying_type(), _fsec);
}

/** Add two instances.
*
* In this case, the second instance can be though of a datetime interval
Expand Down

0 comments on commit 444fd10

Please sign in to comment.