Subject: [Boost-bugs] [Boost C++ Libraries] #5195: time_duration visualizer works incorrectly with negative duration
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-02-16 13:29:20
#5195: time_duration visualizer works incorrectly with negative duration
---------------------------------------------+------------------------------
Reporter: Igor R. <boost.lists@â¦> | Owner: fkonvick
Type: Bugs | Status: new
Milestone: To Be Determined | Component: date_time
Version: Boost 1.46.0 | Severity: Cosmetic
Keywords: |
---------------------------------------------+------------------------------
86400000000 unsigned 64 bit integer is mixed with signed integers.
The fix is to use 86400000000I64 instead, as follows:
;------------------------------------------------------------------------------
; boost::posix_time::time_duration visualizer
; only works with microseconds resolution
;------------------------------------------------------------------------------
boost::posix_time::time_duration{
preview
(
#(
$c.ticks_.value_/86400000000I64,
"d ",
($c.ticks_.value_-
86400000000I64*($c.ticks_.value_/86400000000I64))/3600000000,
"h ",
($c.ticks_.value_-
86400000000I64*($c.ticks_.value_/86400000000I64)-3600000000*(($c.ticks_
.value_-
86400000000I64*($c.ticks_.value_/86400000000I64))/3600000000))/60000000,
"m ",
(($c.ticks_.value_-
86400000000I64*($c.ticks_.value_/86400000000I64)-3600000000*(($c.ticks_
.value_-
86400000000I64*($c.ticks_.value_/86400000000I64))/3600000000))-60000000*(($c.ticks_
.value_-86400000000I64*($c.ticks_.value_/86400000000I64) -
3600000000*(($c.ticks_.value_-
86400000000I64*($c.ticks_.value_/86400000000I64))/3600000000))/60000000))/1000000,
"s ",
($c.ticks_.value_%1000000)/1000,
"ms ",
$c.ticks_.value_%1000,
"us"
)
)
}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5195> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC