mirror of
https://github.com/Z3Prover/z3
synced 2025-08-10 05:00:51 +00:00
Update MPF toString
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
parent
e1e594be75
commit
09814128a6
1 changed files with 5 additions and 6 deletions
|
@ -1181,14 +1181,13 @@ std::string mpf_manager::to_string(mpf const & x) {
|
||||||
|
|
||||||
if (is_nan(x))
|
if (is_nan(x))
|
||||||
res = "NaN";
|
res = "NaN";
|
||||||
else {
|
else {
|
||||||
res = sgn(x) ? "-" : "";
|
|
||||||
|
|
||||||
if (is_inf(x))
|
if (is_inf(x))
|
||||||
res += "INF";
|
res = sgn(x) ? "-oo" : "+oo";
|
||||||
else if (is_zero(x))
|
else if (is_zero(x))
|
||||||
res += "0";
|
res = sgn(x) ? "-zero" : "+zero";
|
||||||
else {
|
else {
|
||||||
|
res = sgn(x) ? "-" : "";
|
||||||
scoped_mpz num(m_mpq_manager), denom(m_mpq_manager);
|
scoped_mpz num(m_mpq_manager), denom(m_mpq_manager);
|
||||||
num = 0;
|
num = 0;
|
||||||
denom = 1;
|
denom = 1;
|
||||||
|
@ -1218,7 +1217,7 @@ std::string mpf_manager::to_string(mpf const & x) {
|
||||||
m_mpq_manager.display_decimal(ss, r, x.sbits);
|
m_mpq_manager.display_decimal(ss, r, x.sbits);
|
||||||
if (m_mpq_manager.is_int(r))
|
if (m_mpq_manager.is_int(r))
|
||||||
ss << ".0";
|
ss << ".0";
|
||||||
ss << " " << exponent;
|
ss << "p" << exponent;
|
||||||
res += ss.str();
|
res += ss.str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue