Opened 14 years ago

Closed 13 years ago

#2512 closed Bugs (fixed)

interval cosh: wrong result if interval contains 0 (but is not identical to [0,0])

Reported by: stephan.puchegger@… Owned by: Boris Gubenko
Milestone: Boost 1.38.0 Component: interval
Version: Boost 1.37.0 Severity: Showstopper
Keywords: Cc:

Description

The last line (line 179) of the cosh function in the file transc.hpp should imho read:

return I(static_cast<T>(1), rnd.cosh_up(-x.lower() > x.upper() ? x.lower() : x.upper()), true);

instead of

return I(static_cast<T>(0), rnd.cosh_up(-x.lower() > x.upper() ? x.lower() : x.upper()), true);

since the cosh(0) == 1. Otherwise the function will return the wrong result.

Change History (1)

comment:1 by Marshall Clow, 13 years ago

Resolution: fixed
Status: newclosed

(In [59350]) Applied patches to fix #2512 and #2513

Note: See TracTickets for help on using tickets.