[ace-users] Division by zero in ACE_Stats::quotient() method
okan.vural at siemens.com
Thu Oct 1 02:00:02 CDT 2015
In the both "ACE_Stats::quotient" methods there seems a potential division by zero problem (See below). It is independent of platform, this is why I didn't send the problem in a Problem Report. And I checked the latest version in ACE SVN as well. It seems still same in the latest version.
ACE Version : V 630
File : Stats.cpp
ACE_Stats::quotient (const ACE_UINT64 dividend,
const ACE_UINT32 divisor,
// The whole part of the division comes from simple integer division.
quotient.whole (static_cast<ACE_UINT32> (divisor == 0
? 0 : dividend / divisor));
if (quotient.precision () > 0 || divisor == 0)
const ACE_UINT32 field = quotient.fractional_field ();
quotient.fractional (static_cast<ACE_UINT32> (
dividend % divisor * field / divisor));
With best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ace-users