Boost C++ Libraries: Ticket #9764: posix_time::time_duration::operator/(int) can trigger division by zero error https://svn.boost.org/trac10/ticket/9764 <p> When dividing time_duration by a 64-bit integer the divisor will be implicitly cast to 'int' type (32-bits on most platforms). </p> <p> This will cause 'division by zero' runtime error for any value which is a multiple of 2<sup>32</sup>. It will also cause invalid values to be calculated if the divisor is larger than 2<sup>31</sup> - 1. </p> <p> I don't see any reason why the time_duration interface should be limited to division by 32-bit integer values on systems where the storage type used in time_duration is at least 64-bit long. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9764 Trac 1.4.3 Michał Ślizak <michal.slizak+boost@…> Mon, 10 Mar 2014 11:13:00 GMT attachment set https://svn.boost.org/trac10/ticket/9764 https://svn.boost.org/trac10/ticket/9764 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">time_duration_problem.cpp</span> </li> </ul> <p> Reproduction </p> Ticket