Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6001 closed Bugs (fixed)

math::tools::roots eps_tolerance wrong behaviour at 0. 0.

Reported by: matwey.kornilov@… Owned by: John Maddock
Milestone: To Be Determined Component: math
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:


at line 34 of toms748_solve.hpp:

return (fabs(a - b) / (std::min)(fabs(a), fabs(b))) <= eps;

this leads to wrong behavior when a=b=0.

fix is trivial:

return fabs(a - b) <= eps * (std::min)(fabs(a), fabs(b));

does almost the same, but it is correct when a=b=0

Change History (2)

comment:1 Changed 7 years ago by John Maddock

Resolution: fixed
Status: newclosed

(In [74890]) Remove unused constants. Fix expression for tolerance in eps_tolerance. Add include guards to prime.hpp. Fixes #5982. Fixes #5927. Fixes #6001.

comment:2 Changed 7 years ago by John Maddock

(In [74984]) Merge recent bug fixes from Trunk. Refs #6014 Refs #5832 Refs #5934 Refs #6001 Refs #5982 Refs #5914 Refs #5927

Note: See TracTickets for help on using tickets.