Re: [Boost-bugs] [Boost C++ Libraries] #2228: signed overflow problem in weighted_sum on VC9.0

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2228: signed overflow problem in weighted_sum on VC9.0
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-08-19 16:06:05


#2228: signed overflow problem in weighted_sum on VC9.0
---------------------------+------------------------------------------------
  Reporter: pavol_droba | Owner: eric_niebler
      Type: Bugs | Status: closed
 Milestone: Boost 1.36.0 | Component: accumulator
   Version: Boost 1.36.0 | Severity: Problem
Resolution: invalid | Keywords:
---------------------------+------------------------------------------------
Changes (by eric_niebler):

  * status: new => closed
  * resolution: => invalid

Comment:

 This is not a bug. The sample is multiplied by the weight. In C++, and int
 multiplied by an unsigned int is an unsigned int. (Try it and see.)

 If you want the result to be an int, use an int for the weight type.

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2228#comment:1>
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:49:58 UTC