Subject: [Boost-bugs] [Boost C++ Libraries] #1829: norm_2 may return QNAN if BOOST_UBLAS_SCALED_NORM is defined
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-04-15 11:29:22
#1829: norm_2 may return QNAN if BOOST_UBLAS_SCALED_NORM is defined
--------------------------------+-------------------------------------------
Reporter: mortituris_at_[hidden] | Owner: guwi17
Type: Bugs | Status: new
Milestone: Boost 1.36.0 | Component: uBLAS
Version: Boost 1.35.0 | Severity: Problem
Keywords: |
--------------------------------+-------------------------------------------
functional.hpp contains a bug which causes norm_2 to return QNAN if the
first component of a vector is zero. The bug is in the
`vector_norm_2::apply` method. It can be fixed by adding `if (0 == u)
continue;` line before
{{{
if (scale < u) {
real_type v (scale / u);
sum_squares = sum_squares * v * v + real_type (1);
scale = u;
} else {
real_type v (u / scale);
sum_squares += v * v;
}
}}}
--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1829>
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:57 UTC