Skip to content

Commit

Permalink
Fix abs(duration) to work with non-normalized ratios
Browse files Browse the repository at this point in the history
  • Loading branch information
HowardHinnant committed Aug 12, 2022
1 parent e6f4aed commit 2c035f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/date/date.h
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ CONSTCD11
std::chrono::duration<Rep, Period>
abs(std::chrono::duration<Rep, Period> d)
{
return d >= d.zero() ? d : -d;
return d >= d.zero() ? d : static_cast<decltype(d)>(-d);
}

// round down
Expand Down

0 comments on commit 2c035f8

Please sign in to comment.