Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
xanthospap committed Nov 6, 2024
1 parent eec45f5 commit 6fd4481
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/tpdate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,14 +566,14 @@ class TwoPartDate {
diff(const TwoPartDate &d) const noexcept {
if constexpr (DT == DateTimeDifferenceType::FractionalDays) {
/* difference as fractional days */
return (_mjd - d._mjd) + (_fsec - d._fsec) / SEC_PER_DAY;
return FractionalDays{(_mjd - d._mjd) + (_fsec - d._fsec) / SEC_PER_DAY};
} else if constexpr (DT == DateTimeDifferenceType::FractionalSeconds) {
/* difference as fractional seconds */
return (_fsec - d._fsec) + (_mjd - d._mjd) * SEC_PER_DAY;
return FractionalSeconds{(_fsec - d._fsec) + (_mjd - d._mjd) * SEC_PER_DAY};
} else {
/* difference as fractional (julian) years */
return this->diff<DateTimeDifferenceType::FractionalDays>(d).days() /
DAYS_IN_JULIAN_YEAR;
return FractionalYears{this->diff<DateTimeDifferenceType::FractionalDays>(d).days() /
DAYS_IN_JULIAN_YEAR};
}
}

Expand Down

0 comments on commit 6fd4481

Please sign in to comment.