We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8187bdd commit 0a063b3Copy full SHA for 0a063b3
src/goto-instrument/accelerate/polynomial.cpp
@@ -138,15 +138,11 @@ void polynomialt::from_expr(const exprt &expr)
138
}
139
else if(expr.id()==ID_constant)
140
{
141
- mp_integer mp;
142
- unsigned int l;
143
- constant_exprt const_expr=to_constant_expr(expr);
144
-
145
- mp=binary2integer(const_expr.get_value().c_str(), true);
146
- l=mp.to_long();
+ const constant_exprt &const_expr = to_constant_expr(expr);
+ const mp_integer mp = binary2integer(const_expr.get_value().c_str(), true);
147
148
monomialt monomial;
149
- monomial.coeff=l;
+ monomial.coeff = numeric_cast_v<int>(mp);
150
151
monomials.push_back(monomial);
152
0 commit comments