Skip to content

Instantly share code, notes, and snippets.

@chfast
Created September 13, 2015 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chfast/9136896f1ee1d214b7a6 to your computer and use it in GitHub Desktop.
Save chfast/9136896f1ee1d214b7a6 to your computer and use it in GitHub Desktop.
boost multiprecision div bug test case
#include <iostream>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/version.hpp>
using u256 = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>>;
int main()
{
std::cout << "Boost " << BOOST_VERSION << std::endl;
u256 a{"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBA"};
u256 b{"0x1DAE6076B981DAE6076B981DAE6076B981DAE6076B981DAE6076B981DAE6077"};
auto c = a / b;
std::cout << c << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment