mirror of
https://github.com/Z3Prover/z3
synced 2025-04-08 18:31:49 +00:00
Added parameter to display floating point numerals as reals
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
parent
7f8a34d2e1
commit
6ebeebde50
|
@ -10,6 +10,7 @@ def_module_params('pp',
|
|||
('decimal', BOOL, False, 'pretty print real numbers using decimal notation (the output may be truncated). Z3 adds a ? if the value is not precise'),
|
||||
('decimal_precision', UINT, 10, 'maximum number of decimal places to be used when pp.decimal=true'),
|
||||
('bv_literals', BOOL, True, 'use Bit-Vector literals (e.g, #x0F and #b0101) during pretty printing'),
|
||||
('fp_real_literals', BOOL, False, 'use real-numbered floating point literals (e.g, +1.0p-1) during pretty printing'),
|
||||
('bv_neg', BOOL, False, 'use bvneg when displaying Bit-Vector literals where the most significant bit is 1'),
|
||||
('flat_assoc', BOOL, True, 'flat associative operators (when pretty printing SMT2 terms/formulas)'),
|
||||
('fixed_indent', BOOL, False, 'use a fixed indentation for applications'),
|
||||
|
|
|
@ -1223,7 +1223,9 @@ std::string mpf_manager::to_string(mpf const & x) {
|
|||
|
||||
std::stringstream ss;
|
||||
m_mpq_manager.display_decimal(ss, r, x.sbits);
|
||||
ss << "p" << exponent; // "p" means 2^exp
|
||||
if (m_mpq_manager.is_int(r))
|
||||
ss << ".0";
|
||||
ss << " " << exponent;
|
||||
res += ss.str();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue