3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-23 03:27:52 +00:00

Reorganizing source code. Created util dir

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-10-20 10:19:38 -07:00
parent 630ba0c675
commit 2c464d413d
153 changed files with 0 additions and 0 deletions

42
src/util/mpq_inf.cpp Normal file
View file

@ -0,0 +1,42 @@
/*++
Copyright (c) 2006 Microsoft Corporation
Module Name:
mpq_inf.cpp
Abstract:
MPQ numbers with infinitesimals
Author:
Leonardo de Moura (leonardo) 2011-06-28
Revision History:
--*/
#include"mpq_inf.h"
template<bool SYNCH>
std::string mpq_inf_manager<SYNCH>::to_string(mpq_inf const & a) const {
if (m.is_zero(a.second))
return m.to_string(a.first);
std::string s = "(";
s += m.to_string(a.first);
if (m.is_neg(a.second))
s += " -e*";
else
s += " +e*";
mpq tmp;
m.set(tmp, a.second);
m.abs(tmp);
s += m.to_string(tmp);
m.del(tmp);
s += ")";
return s;
}
template class mpq_inf_manager<true>;
template class mpq_inf_manager<false>;