Subject: [Boost-bugs] [Boost C++ Libraries] #12798: Strange division evaluation for dynamically allocated `cpp_bin_float`
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-01-31 12:43:27
#12798: Strange division evaluation for dynamically allocated `cpp_bin_float`
-------------------------------------+----------------------------
Reporter: michel | Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: multiprecision
Version: Boost Development Trunk | Severity: Problem
Keywords: |
-------------------------------------+----------------------------
With this code
{{{
#include <iostream>
#include <boost/multiprecision/cpp_bin_float.hpp>
using namespace boost::multiprecision;
using Real = number<cpp_bin_float<10000, digit_base_10,
std::allocator<void>>>;
int main(int argc, char* argv[])
{
std::cout << 1 / Real(1.4) << std::endl;
return 0;
}
}}}
assertion fails as
{{{
Assertion failed:
((
eval_msb(q)
==
cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE,
MaxE>::bit_count - 1
)),
function eval_divide, file boost/multiprecision/cpp_bin_float.hpp, line
1086.
}}}
or it prints `26699.6` when compiled with `NDEBUG`.
If I change `Real(1.4)` to `Real(1)`, the program does not terminate.
Tested on g++-5.4.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12798> 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:21 UTC