File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -390,10 +390,10 @@ cdef class Expr(ExprLike):
390390 Note: base must be positive.
391391 """
392392 if _is_number(other):
393- base = float ( other)
393+ base = < double > other
394394 if base <= 0.0 :
395395 raise ValueError (" Base of a**x must be positive, as expression is reformulated to scip.exp(x * scip.log(a)); got %g " % base)
396- return exp (self * log (base))
396+ return (self * Constant (base).log()).exp( )
397397 else :
398398 raise TypeError (f" Unsupported base type {type(other)} for exponentiation." )
399399
@@ -686,10 +686,10 @@ cdef class GenExpr(ExprLike):
686686 Note: base must be positive.
687687 """
688688 if _is_number(other):
689- base = float ( other)
689+ base = < double > other
690690 if base <= 0.0 :
691691 raise ValueError (" Base of a**x must be positive, as expression is reformulated to scip.exp(x * scip.log(a)); got %g " % base)
692- return exp (self * log (base))
692+ return (self * Constant (base).log()).exp( )
693693 else :
694694 raise TypeError (f" Unsupported base type {type(other)} for exponentiation." )
695695
You can’t perform that action at this time.
0 commit comments