Opened 6 years ago

#12252 new Bugs

numeric_cast<int64_t>(pow(2.0, 63.0)) doesn't throw

Reported by: wellnhofer@… Owned by: Douglas Gregor
Milestone: To Be Determined Component: numeric
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc:

Description

The following code produces an overflow but doesn't throw:

int64_t v = numeric_cast<int64_t>(pow(2.0, 63.0));

For an explanation, see http://stackoverflow.com/a/30424410/1956010

Change History (0)

Note: See TracTickets for help on using tickets.