Opened 12 years ago

Last modified 4 years ago

#4179 new Bugs

time_duration::operator*(int) has no versions for double and int64_t causing implicit truncating them to int32_t

Reported by: anonymous Owned by: James E. King, III
Milestone: Boost 1.43.0 Component: date_time
Version: Boost 1.42.0 Severity: Problem
Keywords: time_duration posix_time date_time Cc:

Description

time_duration::operator*(int) has no versions for double and int64_t causing implicit truncating them to int32_t

  std::cout << boost::posix_time::microseconds(1) * 1e8 << std::endl;
  std::cout << boost::posix_time::microseconds(1) * 1e9 << std::endl;
  std::cout << boost::posix_time::microseconds(1) * 1e10 << std::endl;
  std::cout << boost::posix_time::microseconds(1) * 1e11 << std::endl;
00:01:40
00:16:40
00:23:30.065408
00:20:15.752192

Attachments (1)

boost.timeDurationArithmeticOnTickType.diff (4.3 KB ) - added by Michał Ślizak 9 years ago.
Changed multiplication and division to accept 'tick_type' instead of 'int'

Download all attachments as: .zip

Change History (7)

comment:1 by anonymous, 12 years ago

Keywords: time_duration posix_time date_time added

comment:2 by anonymous, 12 years ago

Owner: changed from az_sw_dude to Andrey Semashev

by Michał Ślizak, 9 years ago

Changed multiplication and division to accept 'tick_type' instead of 'int'

comment:3 by anonymous, 6 years ago

Is there any plan to integrate the fix in a coming release?

comment:4 by jpo38 <jean.porcherot@…>, 6 years ago

Is there any plan to integrate the fix in a coming release?

comment:5 by James E. King, III, 4 years ago

Owner: changed from Andrey Semashev to James E. King, III

comment:6 by James E. King, III, 4 years ago

This appears to be a problem for many operators.

Note: See TracTickets for help on using tickets.