Skip to content

Commit 042d74d

Browse files
Merge branch 'move-cast-in-rational-chooseSemiconv' into 'v100-bugfix'
move cast in rational.cpp:chooseSemiconv() See merge request integer/scip!4059
2 parents 2de6c41 + c7cd604 commit 042d74d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/scip/rational.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2253,10 +2253,10 @@ void chooseSemiconv(
22532253
scip::Integer* p, /**< the last 3 numerators of convergents */
22542254
scip::Integer* q, /**< the last 3 denominators of convergents */
22552255
const scip::Integer& ai, /**< the coefficient in the continuous fraction */
2256-
SCIP_Longint maxdenom /**< the maximal denominator */
2256+
const scip::Integer& maxdenom /**< the maximal denominator */
22572257
)
22582258
{
2259-
scip::Integer j = (scip::Integer(maxdenom) - q[0]) / q[1];
2259+
scip::Integer j = (maxdenom - q[0]) / q[1];
22602260

22612261
if( j >= ai / 2 )
22622262
{
@@ -2635,7 +2635,7 @@ void SCIPrationalComputeApproximation(
26352635
else
26362636
{
26372637
SCIPdebug(std::cout << " picking semiconvergent " << std::endl);
2638-
chooseSemiconv(resnum, resden, p, q, 1, maxdenom);
2638+
chooseSemiconv(resnum, resden, p, q, 1, scip::Integer(maxdenom));
26392639
SCIPdebug(std::cout << " use " << resnum << "/" << resden << std::endl);
26402640
res->val = scip::Rational(resnum,resden) * sign;
26412641
}
@@ -2644,9 +2644,9 @@ void SCIPrationalComputeApproximation(
26442644
else
26452645
{
26462646
if( forcegreater != 0 )
2647-
chooseSemiconv(resnum, resden, p, q, 1, maxdenom);
2647+
chooseSemiconv(resnum, resden, p, q, 1, scip::Integer(maxdenom));
26482648
else
2649-
chooseSemiconv(resnum, resden, p, q, ai, maxdenom);
2649+
chooseSemiconv(resnum, resden, p, q, ai, scip::Integer(maxdenom));
26502650
SCIPdebug(std::cout << " picking semiconvergent " << std::endl);
26512651
SCIPdebug(std::cout << " use " << resnum << "/" << resden << std::endl);
26522652
res->val = scip::Rational(resnum,resden) * sign;

0 commit comments

Comments
 (0)