Skip to content

Commit

Permalink
Fix Ginac cast error
Browse files Browse the repository at this point in the history
../src/sage/symbolic/ginac/upoly-ginac.cpp(219): error C2440: '<function-style-cast>': cannot convert from 'size_t' to 'GiNaC::numeric'
../src/sage/symbolic/ginac/upoly-ginac.cpp(219): note: 'GiNaC::numeric::numeric': ambiguous call to overloaded function
  • Loading branch information
tobiasdiez committed Nov 3, 2024
1 parent 1b3f398 commit 7f2d945
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sage/symbolic/ginac/upoly-ginac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ std::pair<ex,ex> quo_rem(const ex &a, const ex &b, const ex &x, bool check_args)
}
for (size_t i=0; i<qvec.size(); ++i)
if (not qvec[i].is_zero())
qvec[i] = qvec[i] * power(x, numeric(i));
qvec[i] = qvec[i] * power(x, numeric(static_cast<int>(i)));
if (avec.size() > bdeg)
avec.resize(bdeg);
for (size_t i=0; i<bdeg; ++i)
if (not avec[i].is_zero())
avec[i] = avec[i] * power(x, numeric(i));
avec[i] = avec[i] * power(x, numeric(static_cast<int>(i)));
return std::make_pair(add(qvec), add(avec));
}

Expand Down Expand Up @@ -565,7 +565,7 @@ ex parfrac(const ex & a, const ex & x)
return a;
size_t expo = ex_to<numeric>(ee).to_int();
for (size_t j=1; j<=expo; ++j) {
ex eee = power(e.op(0), numeric(j));
ex eee = power(e.op(0), numeric(static_cast<int>(j)));
factor.push_back(eee);
cofac.push_back((facmul/eee).expand());
}
Expand All @@ -582,7 +582,7 @@ ex parfrac(const ex & a, const ex & x)
return a;
size_t expo = ex_to<numeric>(facmul.op(1)).to_int();
for (size_t j=1; j<=expo; ++j) {
ex ee = power(facmul.op(0), numeric(j));
ex ee = power(facmul.op(0), numeric(static_cast<int>(j)));
factor.push_back(ee);
cofac.push_back((facmul/ee).expand());
}
Expand Down

0 comments on commit 7f2d945

Please sign in to comment.