diff options
Diffstat (limited to 'boost/chrono/floor.hpp')
-rw-r--r-- | boost/chrono/floor.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/boost/chrono/floor.hpp b/boost/chrono/floor.hpp index e133e49c8a..eb85fa7446 100644 --- a/boost/chrono/floor.hpp +++ b/boost/chrono/floor.hpp @@ -24,7 +24,9 @@ namespace boost template <class To, class Rep, class Period> To floor(const duration<Rep, Period>& d) { - return duration_cast<To>(d); + To t = duration_cast<To>(d); + if (t>d) --t; + return t; } |