Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12234: boost::multiprecision x64 win32 hard compile errors on windows with mpir
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-05-30 13:31:31
#12234: boost::multiprecision x64 win32 hard compile errors on windows with mpir
-------------------------------+----------------------------
Reporter: tlyons@⦠| Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: multiprecision
Version: Boost 1.61.0 | Severity: Showstopper
Resolution: | Keywords: mpir x64
-------------------------------+----------------------------
Comment (by tlyons@â¦):
I should have given the code example that triggered the problem. Uncomment
the relevant part and it runs successfully:
{{{
#include "stdafx.h"
#include <boost/multiprecision/gmp.hpp>
#include <boost/math/special_functions/gamma.hpp>
#include "Safeint3.hpp" // for a safe fix: http://safeint.codeplex.com/
#include <iostream>
namespace boost {
namespace multiprecision {
template <unsigned Digits10>
struct gmp_float;
typedef number<gmp_float<100> > mpf_float_100;
}
} // namespaces
/*
// uncomment this block to fix the code
double __gmpf_get_d_2exp(long * p, mpf_srcptr a) {
mpir_si temp{ *p };
double b = __gmpf_get_d_2exp(&temp, a);
*p = SafeInt<long>(temp);
return b;
}
*/
using namespace boost::multiprecision;
int fourth() {
mpf_float_100 b = 2;
std::cout << std::numeric_limits<mpf_float_100>::digits <<
std::endl;
// We can use any C++ std lib function:
std::cout << log(b) << std::endl; // print log(2)// ERROR on this
line
// We can also use any function from Boost.Math:
std::cout << boost::math::tgamma(b) << std::endl;
// These even work when the argument is an expression template:
std::cout << boost::math::tgamma(b * b) << std::endl;
return 0;
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12234#comment:1> 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:20 UTC