Subject: [Boost-bugs] [Boost C++ Libraries] #2737: Rounding failed for -0.5
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-02-10 02:26:22
#2737: Rounding failed for -0.5
-----------------------------------------+----------------------------------
Reporter: kennant.tom_at_[hidden] | Owner: dgregor
Type: Bugs | Status: new
Milestone: Boost 1.38.0 | Component: numeric
Version: Boost 1.37.0 | Severity: Problem
Keywords: |
-----------------------------------------+----------------------------------
using namespace boost::numeric;
typedef int T;
typedef double S;
typedef conversion_traits<T, S> Traits;
int i = converter<T, S, Traits, def_overflow_handler,
RoundEven<Traits::source_type> >::convert(-0.5);
When I run the code above, -0.5 will be converted to 0, but I expect -0.5
to be converted to -1.
The same problem goes for 0.5 as well.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2737> 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