-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ed1c03
commit dc54b49
Showing
3 changed files
with
85 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "tpdate.hpp" | ||
|
||
dso::TwoPartDate | ||
dso::TwoPartDateUTC::operator-(const dso::TwoPartDateUTC &d) const noexcept { | ||
const int dmjd = this->imjd() - d.imjd(); | ||
const double dsec = this->seconds() - d.seconds(); | ||
double dleap = 0e0; | ||
if (dmjd) { | ||
/* not on same day */ | ||
int dat1 = dso::dat(modified_julian_day(this->imjd())); | ||
int dat2 = dso::dat(modified_julian_day(d.imjd())); | ||
dleap = static_cast<double>(dat1 - dat2); | ||
} | ||
return TwoPartDate(dmjd, dsec + dleap); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters