3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-07 18:05:21 +00:00

Use std::hexfloat more. (#6203)

Previously, we were only using std::hexfloat on Windows on VS2013
and later.

Since std::hexfloat is part of C++11 and we require C++11 to build
the Z3 library, this should be supported everywhere.
This commit is contained in:
Bruce Mitchener 2022-07-29 16:49:56 +07:00 committed by GitHub
parent 75339c6db7
commit eba29a280d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1630,11 +1630,7 @@ std::string mpf_manager::to_string_hexfloat(mpf const & x) {
std::ios_base::showpoint | std::ios_base::showpos);
ss.setf(ff);
ss.precision(13);
#if defined(_WIN32) && _MSC_VER >= 1800
ss << std::hexfloat << to_double(x);
#else
ss << std::hex << (*reinterpret_cast<const unsigned long long *>(&(x)));
#endif
return ss.str();
}