Skip to content
This repository was archived by the owner on May 11, 2021. It is now read-only.

Commit d217fe9

Browse files
committed
fix(opensmt/egraph/Enode.C): use 16-digit precision when printing Enode
1 parent f0f2705 commit d217fe9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/opensmt/egraph/Enode.C

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ You should have received a copy of the GNU General Public License
1717
along with OpenSMT. If not, see <http://www.gnu.org/licenses/>.
1818
*********************************************************************/
1919

20+
#include <iomanip>
2021
#include "Enode.h"
2122
#include "util/string.h"
2223

2324
using std::unordered_set;
24-
25+
using std::setprecision;
2526
//
2627
// Constructor for ENIL
2728
//
@@ -87,9 +88,9 @@ Enode::Enode( const enodeid_t id_
8788
assert( cdr );
8889
assert( car->isTerm( ) || car->isSymb( ) || car->isNumb( ) );
8990
assert( cdr->isList( ) );
90-
91+
9192
isHolder = false;
92-
93+
9394
//
9495
// If car is term, then this node is a list
9596
//
@@ -342,7 +343,7 @@ void Enode::print_infix(ostream & os, lbool polarity, string const & variable_po
342343
if (name.find('e') != std::string::npos || name.find('E') != std::string::npos) {
343344
// Scientific Notation
344345
double r = *(symb_data->value);
345-
os << std::fixed << r;
346+
os << setprecision(16) << r;
346347
} else {
347348
// Fixed Notation
348349
os << name;
@@ -449,7 +450,7 @@ void Enode::print(ostream & os) {
449450
os << getName();
450451
} else if (isNumb()) {
451452
double r = *(symb_data->value);
452-
os << r;
453+
os << setprecision(16) << r;
453454
} else if (isTerm()) {
454455
if (!cdr->isEnil())
455456
os << "(";

0 commit comments

Comments
 (0)