mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-25 23:40:53 +08:00
Fix abs(duration) to work with non-normalized ratios
This commit is contained in:
parent
e6f4aed4d1
commit
2c035f8def
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user