mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-12 09:23:12 +08:00
patch mpfr c++ copy to fix warnings and min/max issues
This commit is contained in:
parent
b5093e2585
commit
7380592bc2
@ -1267,7 +1267,7 @@ int mspace_mallopt(int, int);
|
||||
#endif /* MSPACES */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}; /* end of extern "C" */
|
||||
} /* end of extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
|
@ -432,7 +432,8 @@ std::string mpreal::toString(const std::string& format) const
|
||||
|
||||
std::string mpreal::toString(int n, int b, mp_rnd_t mode) const
|
||||
{
|
||||
|
||||
(void)b;
|
||||
(void)mode;
|
||||
#if (MPFR_VERSION >= MPFR_VERSION_NUM(2,4,0))
|
||||
|
||||
// Use MPFR native function for output
|
||||
|
@ -538,7 +538,7 @@ private:
|
||||
//
|
||||
// at the beginning of
|
||||
// [Visual Studio Installation Folder]\Common7\Packages\Debugger\autoexp.dat
|
||||
MPREAL_MSVC_DEBUGVIEW_DATA;
|
||||
MPREAL_MSVC_DEBUGVIEW_DATA
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@ -689,8 +689,8 @@ inline int bits2digits(mp_prec_t b);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// min, max
|
||||
const mpreal max(const mpreal& x, const mpreal& y);
|
||||
const mpreal min(const mpreal& x, const mpreal& y);
|
||||
const mpreal (max)(const mpreal& x, const mpreal& y);
|
||||
const mpreal (min)(const mpreal& x, const mpreal& y);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Implementation
|
||||
@ -1557,7 +1557,7 @@ inline bool isEqualUlps(const mpreal& a, const mpreal& b, int maxUlps)
|
||||
/*
|
||||
maxUlps - a and b can be apart by maxUlps binary numbers.
|
||||
*/
|
||||
return abs(a - b) <= machine_epsilon(max(abs(a), abs(b))) * maxUlps;
|
||||
return abs(a - b) <= machine_epsilon((max)(abs(a), abs(b))) * maxUlps;
|
||||
}
|
||||
|
||||
inline bool isEqualFuzzy(const mpreal& a, const mpreal& b, const mpreal& eps)
|
||||
|
Loading…
x
Reference in New Issue
Block a user