[Boost-bugs] [Boost C++ Libraries] #7905: boost::math::policies::raise_rounding_error returns the wrong min/max values for ignore_error and errno_on_error

Subject: [Boost-bugs] [Boost C++ Libraries] #7905: boost::math::policies::raise_rounding_error returns the wrong min/max values for ignore_error and errno_on_error
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-01-18 23:21:48


#7905: boost::math::policies::raise_rounding_error returns the wrong min/max
values for ignore_error and errno_on_error
--------------------------------+-------------------------------------------
 Reporter: benkerby@… | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.52.0
 Severity: Problem | Keywords:
--------------------------------+-------------------------------------------
 In the documentation for the rounding functions, in "Table 6. Possible
 Actions for Rounding Errors", it says that the round function will return
 "the largest representable value of the '''target''' integer type (or the
 most negative value if the argument to the function was less than zero).

 However, the specializations of the raise_rounding_error function for
 ignore_error and errno_on_error call std::numeric_limits min() and max()
 with the source type rather than the result type.

 For example, calling
 {{{
 iround(INT_MAX + 1.0)
 }}}
 will return
 {{{
 static_cast<int>(std::numeric_limits<double>::max())
 }}}
 rather than
 {{{
 static_cast<int>(std::numeric_limits<int>::max())
 }}}
 as was specified.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7905>
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:50:11 UTC