mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 13:28:47 +00:00
Build fix for old systems that don't have a float remainder(...) function.
This commit is contained in:
parent
10cc8c3a75
commit
cba82325de
|
@ -383,10 +383,10 @@ void hwf_manager::round_to_integral(mpf_rounding_mode rm, hwf const & x, hwf & o
|
||||||
}
|
}
|
||||||
|
|
||||||
void hwf_manager::rem(hwf const & x, hwf const & y, hwf & o) {
|
void hwf_manager::rem(hwf const & x, hwf const & y, hwf & o) {
|
||||||
#if defined(_WINDOWS) && _MSC_VER < 1800
|
#if defined(_WINDOWS) && _MSC_VER < 1700
|
||||||
o.value = fmod(x.value, y.value);
|
o.value = fmod(x.value, y.value);
|
||||||
if (o.value >= (y.value/2))
|
if (o.value >= (y.value/2.0))
|
||||||
o.value /= 2.0;
|
o.value -= y.value;
|
||||||
#else
|
#else
|
||||||
o.value = remainder(x.value, y.value);
|
o.value = remainder(x.value, y.value);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1412,7 +1412,11 @@ std::string mpf_manager::to_string_hexfloat(mpf const & x) {
|
||||||
std::ios::fmtflags ff = ss.setf(std::ios_base::hex | std::ios_base::uppercase |
|
std::ios::fmtflags ff = ss.setf(std::ios_base::hex | std::ios_base::uppercase |
|
||||||
std::ios_base::showpoint | std::ios_base::showpos);
|
std::ios_base::showpoint | std::ios_base::showpos);
|
||||||
ss.precision(13);
|
ss.precision(13);
|
||||||
|
#if defined(_WIN32) && _MSC_VER >= 1800
|
||||||
ss << std::hexfloat << to_double(x);
|
ss << std::hexfloat << to_double(x);
|
||||||
|
#else
|
||||||
|
ss << std::hex << (*reinterpret_cast<const unsigned long long *>(&(x)));
|
||||||
|
#endif
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue