From: Aina Niemetz Date: Tue, 20 Oct 2020 11:41:49 +0000 (-0700) Subject: Integer (CLN): Minor improvements. (#5306) X-Git-Tag: cvc5-1.0.0~2689 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5fb1ec459d6d94c1326ab1befe8ce8b8fbc8cfd3;p=cvc5.git Integer (CLN): Minor improvements. (#5306) Review comments by @nafur from #5304. --- diff --git a/src/util/integer_cln_imp.cpp b/src/util/integer_cln_imp.cpp index 05293529c..88db707d9 100644 --- a/src/util/integer_cln_imp.cpp +++ b/src/util/integer_cln_imp.cpp @@ -357,11 +357,11 @@ int Integer::sgn() const return cln::cl_I_to_int(sgn); } -bool Integer::strictlyPositive() const { return sgn() > 0; } +bool Integer::strictlyPositive() const { return cln::plusp(d_value); } -bool Integer::strictlyNegative() const { return sgn() < 0; } +bool Integer::strictlyNegative() const { return cln::minusp(d_value); } -bool Integer::isZero() const { return sgn() == 0; } +bool Integer::isZero() const { return cln::zerop(d_value); } bool Integer::isOne() const { return d_value == 1; } @@ -417,14 +417,14 @@ void Integer::readInt(const cln::cl_read_flags& flags, size_t pos = s.find_first_not_of('0'); if (pos == std::string::npos) { - d_value = read_integer(flags, "0", NULL, NULL); + d_value = cln::read_integer(flags, "0", NULL, NULL); } else { const char* cstr = s.c_str(); const char* start = cstr + pos; const char* end = cstr + s.length(); - d_value = read_integer(flags, start, end, NULL); + d_value = cln::read_integer(flags, start, end, NULL); } } catch (...)