Re: [Boost-bugs] [Boost C++ Libraries] #2473: unsigned integers going into interval of doubles get wrongly negated

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2473: unsigned integers going into interval of doubles get wrongly negated
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-03-12 22:49:51


#2473: unsigned integers going into interval of doubles get wrongly negated
------------------------------------------------------+---------------------
  Reporter: David Monniaux <David.Monniaux_at_[hidden]> | Owner: bgubenko
      Type: Bugs | Status: new
 Milestone: Boost 1.38.0 | Component: interval
   Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords: unsigned
------------------------------------------------------+---------------------

Comment(by guwi17):

 I tracked the source of the problem down to rounded_arith.hpp:93 where
 (-v) is computed although the type of v is and unsigned integer.

 Additionally I wonder why the constructor of interval<T> is
 template <T1, T2> interval(T1, T2) and not simply interval(T,T). The
 latter constructor would enforce the conversion to the correct type and
 prevent the shown bug.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2473#comment:2>
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:59 UTC